This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30502] compiler inlines slightly invalid function without warning
- From: "yakov at emc dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2007 19:18:27 -0000
- Subject: [Bug c/30502] compiler inlines slightly invalid function without warning
- References: <bug-30502-13942@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from yakov at emc dot com 2007-01-18 19:18 -------
Subject: Re: compiler inlines slightly invalid function without
warning
gcc -O2 -Wall -c -fno-inline rtv.c
rtv.c: In function `compute_tables_error_code':
rtv.c:18: warning: control reaches end of non-void function
gcc -O2 -Wall -c rtv.c <-- no warning here
With '-fno-inline' compiler generates very useful warning - the return
stmt has been missing.
This is my point.
sincerely,
yakov
pinskia at gcc dot gnu dot org wrote:
>------- Comment #1 from pinskia at gcc dot gnu dot org 2007-01-18 18:00 -------
>I think you mean the following options:
>-O2 -Wall -Winline
>and with 4.0.0 and above I get:
>t.c:9: warning: control may reach end of non-void function
>'compute_tables_error_code' being inlined
>or:
>t.c: In function 'compute_tables_error_code':
>t.c:19: warning: control reaches end of non-void function
>
>PS this is not really invalid code, just undefined code.
>
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30502