From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11548 invoked by alias); 4 May 2012 16:09:59 -0000 Received: (qmail 11531 invoked by uid 22791); 4 May 2012 16:09:57 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 May 2012 16:09:44 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53232] No warning for main() without a return statement with -std=c99 Date: Fri, 04 May 2012 16:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg00448.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53232 --- Comment #6 from Jonathan Wakely 2012-05-04 16:09:40 UTC --- (In reply to comment #5) > (In reply to comment #4) > > IMHO this isn't a bug because in C99 it's well-defined what happens if you fall > > off the end of main, > > Only at program termination (if my interpretation of C99 is correct). Please > read again the bug report and the links. I did. Please read the last sentence of comment 4. > > so it would annoy people to issue a warning on perfectly valid code > > whenever -Wall is enabled. > > Well, GCC has various warnings on perfectly valid code, just because the code > is suspicious. This is the case here too. Yes, and in each case some people want it and some don't. I'm pointing out to Manu the reasons not everyone wants the warning. Your opinion isn't the only valid one. > And there are potential portability > problems (not everyone may use a C99 compiler). So, good reasons to issue a > warning. Er, if you want to find portability problems for people not using C99 then don't use -std=c99. Then -Wreturn-type warns about main.