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/48116] New: -Wreturn-type does not work as advertised


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

           Summary: -Wreturn-type does not work as advertised
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tromey@gcc.gnu.org


I'm using svn trunk gcc as of today.

-Wreturn-type is documented as:

  [... warn] about a `return' statement with a expression
  in a function whose return-type is `void'.

I tried it with this test case:

void x (void) { }
void y(void) { return x(); }

I expected a warning on the `return', but did not get one:

I used "gcc -Wreturn-type -O2 -c q.c"


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