http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47035

--- Comment #2 from Jack Howarth <howarth at nitro dot med.uc.edu> 2010-12-22 
15:24:27 UTC ---
This issue actually exists on linux as well. The behavior is rather complex.
For example, the first instance of a compilation of trunctfxf2.c shows the
missing prototype warnings ...

/home/howarth/work/./gcc/xgcc -B/home/howarth/work/./gcc/
-B/home/howarth/dist/x86_64-unknown-linux-gnu/bin/
-B/home/howarth/dist/x86_64-unknown-linux-gnu/lib/ -isystem
/home/howarth/dist/x86_64-unknown-linux-gnu/include -isystem
/home/howarth/dist/x86_64-unknown-linux-gnu/sys-include    -g -O2 -O2  -g -O2
-DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector 
 -I. -I. -I../.././gcc -I../../../gcc/libgcc -I../../../gcc/libgcc/.
-I../../../gcc/libgcc/../gcc -I../../../gcc/libgcc/../include
-I../../../gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS 
-DUSE_TLS -o trunctfxf2.o -MT trunctfxf2.o -MD -MP -MF trunctfxf2.dep
-fexceptions -c ../../../gcc/libgcc/../gcc/config/soft-fp/trunctfxf2.c
-fvisibility=hidden -DHIDE_EXPORTS
../../../gcc/libgcc/../gcc/config/soft-fp/trunctfdf2.c:36:8: warning: no
previous prototype for ‘__trunctfdf2’ [-Wmissing-prototypes]
../../../gcc/libgcc/../gcc/config/soft-fp/trunctfsf2.c:36:8: warning: no
previous prototype for ‘__trunctfsf2’ [-Wmissing-prototypes]
../../../gcc/libgcc/../gcc/config/soft-fp/trunctfxf2.c:35:8: warning: no
previous prototype for ‘__trunctfxf2’ [-Wmissing-prototypes]

whereas the next instance properly uses '-Wno-missing-prototypes
-Wno-type-limits' from libgcc/config/t-softfp...

/home/howarth/work/./gcc/xgcc -B/home/howarth/work/./gcc/
-B/home/howarth/dist/x86_64-unknown-linux-gnu/bin/
-B/home/howarth/dist/x86_64-unknown-linux-gnu/lib/ -isystem
/home/howarth/dist/x86_64-unknown-linux-gnu/include -isystem
/home/howarth/dist/x86_64-unknown-linux-gnu/sys-include    -g -O2 -m32 -O2  -g
-O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector 
 -I. -I. -I../../.././gcc -I../../../../gcc/libgcc -I../../../../gcc/libgcc/.
-I../../../../gcc/libgcc/../gcc -I../../../../gcc/libgcc/../include
-I../../../../gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT
-DHAVE_CC_TLS  -DUSE_TLS -Wno-missing-prototypes -Wno-type-limits -o
trunctfxf2.o -MT trunctfxf2.o -MD -MP -MF trunctfxf2.dep -fexceptions -c
../../../../gcc/libgcc/../gcc/config/soft-fp/trunctfxf2.c -fvisibility=hidden
-DHIDE_EXPORTS

and doesn't generate the 'missing prototype' warnings. I am having a difficult
time seeing the logic of when '-Wno-missing-prototypes -Wno-type-limits' since
immediately after the second compilation of trunctfxf2.c, which gets
'-Wno-missing-prototypes -Wno-type-limits', occurs...

/home/howarth/work/./gcc/xgcc -B/home/howarth/work/./gcc/
-B/home/howarth/dist/x86_64-unknown-linux-gnu/bin/
-B/home/howarth/dist/x86_64-unknown-linux-gnu/lib/ -isystem
/home/howarth/dist/x86_64-unknown-linux-gnu/include -isystem
/home/howarth/dist/x86_64-unknown-linux-gnu/sys-include    -g -O2 -O2  -g -O2
-DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector 
 -I. -I. -I../.././gcc -I../../../gcc/libgcc -I../../../gcc/libgcc/.
-I../../../gcc/libgcc/../gcc -I../../../gcc/libgcc/../include
-I../../../gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS 
-DUSE_TLS -o unordtf2_s.o -MT unordtf2_s.o -MD -MP -MF unordtf2_s.dep -DSHARED
-fexceptions -c ../../../gcc/libgcc/../gcc/config/soft-fp/unordtf2.c
../../../gcc/libgcc/../gcc/config/soft-fp/unordtf2.c:34:9: warning: no previous
prototype for ‘__unordtf2’ [-Wmissing-prototypes]
../../../gcc/libgcc/../gcc/config/soft-fp/unordtf2.c: In function ‘__unordtf2’:
../../../gcc/libgcc/../gcc/config/soft-fp/unordtf2.c:37:1: warning: variable
‘B_s’ set but not used [-Wunused-but-set-variable]
../../../gcc/libgcc/../gcc/config/soft-fp/unordtf2.c:36:1: warning: variable
‘A_s’ set but not used [-Wunused-but-set-variable]

where  '-Wno-missing-prototypes -Wno-type-limits' is omitted. Odd.

Reply via email to