Mercury Bugs - mercury
View Issue Details
0000441mercuryBugpublic2017-10-18 22:472017-10-18 23:42
Reporterjuliensf 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000441: Invalid C code for program in hlc.gc grade
DescriptionThe attached program compiles and runs successfully in the asm_fast.gc grade. The generated C code
fails to compile in the hlc.gc grade with the following error:

Mercury/cs/test_vfm2.c: In function ‘test_vfm2__hello_1_f_0’:
Mercury/cs/test_vfm2.c:130:18: error: void value not ignored as it ought to be
     HeadVar__2_2 = vfm2__printLine_2_f_0(TypeCtorInfo_5_5, TypeCtorInfo_6_6, ((MR_Box) (Var_4)), FIO_3);
                  ^
** Error making `Mercury/os/test_vfm2.o'.

This is using rotd-2017-10-15 (although it also occurs with old roads).
TagsNo tags attached.
Attached Filesgz vfm2_bug.tar.gz (702) 2017-10-18 22:47
https://bugs.mercurylang.org/file_download.php?file_id=273&type=bug

Notes
(0000958)
zs   
2017-10-18 23:42   
The problem is NOT we generate the line that the error message is for.
The problem is that vfm2.m knows that fio is a dummy type, and makes
the return type of vfm2__printline_2_f_0 void accordingly, even though it keeps
the definition of fio(T) *private*. This means that fio is NOT known to be a dummy
type anywhere but inside the vfm2 module.

We will need to split the concept of "dummy type" into two: dummy types
that are known to be dummy everywhere, and those known to be dummy
only in their defining module.

Issue History
2017-10-18 22:47juliensfNew Issue
2017-10-18 22:47juliensfFile Added: vfm2_bug.tar.gz
2017-10-18 23:28zsAssigned To => zs
2017-10-18 23:28zsStatusnew => assigned
2017-10-18 23:42zsNote Added: 0000958