2024-11-23 20:35 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000019mercuryBugpublic2007-10-16 17:37
Reporterwangp 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000019: foreign type mutables don't work in high-level C grades
DescriptionIn 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 InformationFor the given modules:

% mmc -m aa -s hlc.gc
Making Mercury/os/aa.o
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
TagsNo tags attached.
Attached Files
  • ? file icon aa.m (606 bytes) 2007-10-16 16:24
  • ? file icon bb.m (840 bytes) 2007-10-16 16:25

-Relationships
+Relationships

-Notes

~0000027

juliensf (administrator)

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.]

+Notes

-Issue History
Date Modified Username Field Change
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
+Issue History