This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/21678] New: Using inline + always_inline disables warnings about missing return statements


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]