This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21678] New: Using inline + always_inline disables warnings about missing return statements
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 May 2005 12:33:44 -0000
- Subject: [Bug c/21678] New: Using inline + always_inline disables warnings about missing return statements
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
There is a weird interaction in using both inline and always_inline:
=============================================================
static inline __attribute__((always_inline)) int foo(int a)
{
if (a==0)
return 0;
}
=============================================================
Compiling with -Wall gives no warning. If you remove either "inline" or the
attribute "always_inline", you get the expected warning:
thermo.i: In function 'foo':
thermo.i:5: warning: control reaches end of non-void function
This happens on both GCC 3.4.3 and 4.1.0.
--
Summary: Using inline + always_inline disables warnings about
missing return statements
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: giovannibajo at libero dot it
CC: batt at develer dot com,bernie at develer dot com,gcc-
bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21678