public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13641] New: calling main: standard requires diagnostic, but diagnostic only with --pedantic
@ 2004-01-10 23:08 bugzilla dot gcc at rtij dot nl
  2004-01-10 23:15 ` [Bug c++/13641] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bugzilla dot gcc at rtij dot nl @ 2004-01-10 23:08 UTC (permalink / raw)
  To: gcc-bugs

Compiling the following program:

int main() { main(); }

Gives no diagnostic until --pedantic is given. The standard doesn't say that no
diagnostic is required, so one is required. In my opinion a diagnostic should be
issued, at least at -Wall.

Actual results:

$ g++ -c main.C
$ g++ -c --pedantic main.C
main.C: In function `int main()':
main.C:1: warning: ISO C++ forbids calling `::main' from within program
main.C:1: warning: ISO C++ forbids taking address of function `::main'

Expected results:
Build without --pedantic should give a diagnostic as well.

Build Date & Platform:
$ g++ --version
g++ (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

Regards,
Martijn Lievaart

-- 
           Summary: calling main: standard requires diagnostic, but
                    diagnostic only with --pedantic
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bugzilla dot gcc at rtij dot nl
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-01-16 18:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-10 23:08 [Bug c++/13641] New: calling main: standard requires diagnostic, but diagnostic only with --pedantic bugzilla dot gcc at rtij dot nl
2004-01-10 23:15 ` [Bug c++/13641] " pinskia at gcc dot gnu dot org
2004-01-10 23:31 ` gdr at integrable-solutions dot net
2004-01-11  4:04 ` pinskia at gcc dot gnu dot org
2004-01-11  4:06 ` [Bug c++/13641] [3.4 Regression] " pinskia at gcc dot gnu dot org
2004-01-12 23:39 ` steven at gcc dot gnu dot org
2004-01-16 18:09 ` mmitchel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).