optimization/7189: gcc -O2 -Wall does not print ``control reaches end of non-void function'' warning
Steven Bosscher
s.bosscher@student.tudelft.nl
Thu Feb 13 15:32:00 GMT 2003
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7189
This is a sibling call optimization bug.
Without any optimization (gcc -c -Wall), the warning is issued
as it should be. When sibling calls are optimized
(gcc -c -Wall -foptimize-sibling-calls), the warning disappears.
# cat c7129.c
extern void foo(void);
int bar(void) { foo(); }
# gcc-3.4 -v
Reading specs from
/opt/experimental/lib/gcc-lib/i586-pc-linux-gnu/3.4/specs
Configured with: ../gcc-trunk/configure --disable-nls --with-gnu-as
--with-gnu-ld --prefix=/opt/experimental --program-suffix=-3.5
--enable-languages=c,c++
Thread model: posix
gcc version 3.4 20030213 (experimental)
# gcc-3.4 -c -Wall c7189.c
c7189.c: In function `bar':
c7189.c:2: warning: control reaches end of non-void function
# gcc-3.4 -c -Wall c7189.c -foptimize-sibling-calls
#
Greetz
Steven
More information about the Gcc-bugs
mailing list