[Bug c/89926] New: -Wmain warning about return type doesn't show location of the return type

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 2 13:53:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89926

            Bug ID: 89926
           Summary: -Wmain warning about return type doesn't show location
                    of the return type
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

As I observed in bug 83797 comment 4, this location looks wrong:

vm.c:1:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
 void main() { }
      ^~~~

I would expect:

vm.cc:1:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
 void main() { }
 ^~~~


More information about the Gcc-bugs mailing list