Mercury Bugs - mercury | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0000250 | mercury | Bug | public | 2012-01-12 14:34 | 2012-05-10 10:12 |
Reporter | mgiuca | ||||
---|---|---|---|---|---|
Assigned To | wangp | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0000250: GCC warnings: used but never defined | ||||
Description | In Mercury 11.07 (grade: asm_fast.gc), all non-trivial Mercury programs are causing GCC 4.6 to spit out lots and lots of "used but never defined" warnings. These seem to be caused whenever a function or predicate is curried. The simplest complete example I can think of is this: :- module gcc_warn. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. :- import_module int. :- pred add(int::in, int::in, int::out) is det. add(X, Y, Z) :- Z = X + Y. :- func add_wrap(int, int) = int. add_wrap(X, Y) = Z :- add(X)(Y, Z). main(!IO) :- io.write(add_wrap(1, 2), !IO), io.nl(!IO). Running: $ mmc gcc_warn.m causes GCC to give the warning: gcc_warn.c:80:1: warning: ‘mercury__gcc_warn__add_3_0’ used but never defined [enabled by default] The warning is generated due to add_wrap, which curries the add predicate. It also happens if add is a function. | ||||
Additional Information | $ gcc --version gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 Using Mercury 11.07 beta 2011-11-16 / grade asm_fast.gc. This started happening when I upgraded to Mercury 11.07, but I also upgraded to Ubuntu 11.10 at the same time, so I don't know whether Mercury or GCC regressed. The specific GCC command that caused this warning was: gcc -I/usr/local/mercury-11.07-beta-2011-11-16/lib/mercury/lib/asm_fast.gc/inc -I/usr/local/mercury-11.07-beta-2011-11-16/lib/mercury/conf -I/usr/local/mercury-11.07-beta-2011-11-16/lib/mercury/inc -O2 -fomit-frame-pointer -fno-strict-aliasing -DMR_USE_GCC_GLOBAL_REGISTERS -DMR_USE_GCC_NONLOCAL_GOTOS -DMR_USE_ASM_LABELS -fno-builtin -fno-omit-frame-pointer -fno-defer-pop -fno-function-cse -fno-gcse -fno-move-loop-invariants -DMR_CONSERVATIVE_GC -DMR_BOEHM_GC -DMR_TAGBITS=2 -ansi -Wall -Wwrite-strings -Wshadow -Wmissing-prototypes -Wno-unused -Wno-uninitialized -Wstrict-prototypes -c gcc_warn.c -o gcc_warn.o The line of C code in question is: MR_decl_static(gcc_warn__add_3_0) | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | gcc_warn.m (474) 2012-01-12 14:34 https://bugs.mercurylang.org/file_download.php?file_id=149&type=bug |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
Issue History | |||||
Date Modified | Username | Field | Change | ||
---|---|---|---|---|---|
2012-01-12 14:34 | mgiuca | New Issue | |||
2012-01-12 14:34 | mgiuca | File Added: gcc_warn.m | |||
2012-01-12 17:36 | wangp | Note Added: 0000444 | |||
2012-01-12 18:01 | mgiuca | Note Added: 0000445 | |||
2012-01-12 18:38 | juliensf | Note Added: 0000446 | |||
2012-05-10 10:12 | wangp | Note Added: 0000454 | |||
2012-05-10 10:12 | wangp | Status | new => resolved | ||
2012-05-10 10:12 | wangp | Resolution | open => fixed | ||
2012-05-10 10:12 | wangp | Assigned To | => wangp |