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/23658] New: bogus warning for missing return value


The testcase below was distilled from GMP source code (thanks to TG).
Consider

  inline int foo (void){ if (1) return 0; }
  int bar () { return foo (); }

compile with "-Wall -O2 -c".  Gcc spits out

tg.c: In function 'bar':
tg.c:2: warning: control may reach end of non-void function 'foo' being inlined

which clearly is bogus as the branch is *always* taken.

-- 
           Summary: bogus warning for missing return value
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gdr at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: platform independent


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23658


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