|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000019||mercury||Bug||public||2007-10-16 16:24||2007-10-16 17:37|
|Target Version||Fixed in Version|
|Summary||0000019: foreign type mutables don't work in high-level C grades|
|Description||In hlc grades, a mutable of a foreign type FT in a module M will result in a variable declaration in M.mih that refers to FT before the #inclusion of the header that defines FT.|
|Additional Information||For the given modules:|
% mmc -m aa -s hlc.gc
In file included from Mercury/cs/aa.c:26:
aa.m:17: error: syntax error before '*' token
aa.m:17: warning: type defaults to `int' in declaration of `aa__mutable_variable_my_bb'
aa.m:17: warning: data definition has no type or storage class
aa.m:17: error: conflicting types for 'aa__mutable_variable_my_bb'
aa.m:17: error: previous declaration of 'aa__mutable_variable_my_bb' was here
** Error making `Mercury/os/aa.o'.
The same thing works in asm_fast.gc
|Tags||No tags attached.|
Last edited: 2007-12-31 11:53
The same thing works in asm_fast.gc because in that grade mutables always
have type MR_Word.
I think that we need to ensure that all mutables that are foreign types
in the hl* grades also have type MR_Word, rather than the foreign type.
(Actually, since we don't know the type in question it should be boxed
anyway.) [I reported a related set of bugs with float and non-word sized
foreign type mutables in the hl* grades at the beginning of this year, I
haven't fixed them yet since I was waiting for zs's parse tree restructure.]
|2007-10-16 16:24||wangp||New Issue|
|2007-10-16 16:24||wangp||File Added: aa.m|
|2007-10-16 16:25||wangp||File Added: bb.m|
|2007-10-16 16:46||juliensf||Note Added: 0000027|
|2007-10-16 16:46||juliensf||Status||new => confirmed|
|2007-10-16 17:37||juliensf||Note Added: 0000028|
|2007-10-16 17:40||juliensf||Note Deleted: 0000028|
|2007-12-31 11:53||juliensf||Note Edited: 0000027|