Description of Problem: When one forgets to return a return value in inline function and the function is successfully inlined, compiler generates no warning about missing return value. (Of course, this can be avoided by compliling without optimization, when no (even inline) functions are actually inlined.) Version-Release number of selected component (if applicable): Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.0.1/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disa ble-checking --host=i386-redhat-linux Thread model: posix gcc version 3.0.1 20010724 (Red Hat Linux 7.1 3.0-5) How Reproducible: Always. Steps to Reproduce: 1. create a file (let's call it inlinewarn.c) with following content: static inline int foo(void) { } int main(void) { foo(); return 0; } 2. compile it $ gcc3 -Wall -O -c inlinewarn.c Actual Results: It compiles without warnings. Expected Results: gcc prints the same warning as without -O (and compiles it): inlinewarn.c: In function `foo': inlinewarn.c:1: warning: control reaches end of non-void function Additional Information: gcc 2.95 prints the warning no matter whether optimizing or not.
Still a problem. Upstream gcc bugzilla for this is http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13000