[Bug c/30502] New: compiler inlines slightly invalid function without warning
yakov at emc dot com
gcc-bugzilla@gcc.gnu.org
Thu Jan 18 17:13:00 GMT 2007
Reading specs from /bin/../lib/gcc/i686-pc-linux-gnu/3.4.6/specs
Configured with: gcc/configure --enable-languages=c,c++ --disable-nls
--disable-c-mbchar --disable-multilib --with-gnu-as --with-gnu-ld
---------------- rtv.c ---------------------------
extern int putchar (int c);
static int __inline__ compute_tables_error_code ( int ots );
int main (void)
{
int err_code = putchar('z');
if (compute_tables_error_code (err_code))
return 1;
else
return 0;
}
static int __inline__ compute_tables_error_code ( int ots )
{
if ( ots )
return 0x85;
}
---------------- rtv.c ---------------------------
gcc -Wall -O2 -fno-inline -Winline rtv.c
rtv.c: In function `compute_tables_error_code':
rtv.c:18: warning: control reaches end of non-void function
rtv.c: In function `main':
rtv.c:15: warning: inlining failed in call to `compute_tables_error_code'
rtv.c:8: warning: called from here
--
Summary: compiler inlines slightly invalid function without
warning
Product: gcc
Version: 3.4.6
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: yakov at emc dot com
GCC target triplet: gcc version 3.4.6 (SuSE Linux)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30502
More information about the Gcc-bugs
mailing list