From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2793 invoked by alias); 16 Nov 2002 13:06:06 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2758 invoked by uid 71); 16 Nov 2002 13:06:04 -0000 Resent-Date: 16 Nov 2002 13:06:04 -0000 Resent-Message-ID: <20021116130604.2756.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, Agthorr Resent-Reply-To: gcc-gnats@gcc.gnu.org, 141015@bugs.debian.org Received: (qmail 1564 invoked from network); 16 Nov 2002 13:00:15 -0000 Received: from unknown (HELO mail.cs.tu-berlin.de) (130.149.17.13) by sources.redhat.com with SMTP; 16 Nov 2002 13:00:15 -0000 Received: from smile.cs.tu-berlin.de (mail@smile.cs.tu-berlin.de [130.149.19.24]) by mail.cs.tu-berlin.de (8.9.3/8.9.3) with ESMTP id NAA24699; Sat, 16 Nov 2002 13:57:23 +0100 (MET) Received: from doko by smile.cs.tu-berlin.de with local (Exim 3.35 #1 (Debian)) id 18D2Vn-0001t3-00; Sat, 16 Nov 2002 13:57:23 +0100 Message-Id: Date: Fri, 22 Nov 2002 09:46:00 -0000 From: Matthias Klose Reply-To: 141015@bugs.debian.org To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 X-GNATS-Notify: Agthorr Subject: c/8609: Superfluous warning when -std=c99/gnu99 and noreturn on main() X-SW-Source: 2002-11/txt/msg00839.txt.bz2 List-Id: >Number: 8609 >Category: c >Synopsis: Superfluous warning when -std=c99/gnu99 and noreturn on main() >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Nov 16 05:06:03 PST 2002 >Closed-Date: >Last-Modified: >Originator: Agthorr >Release: 3.2.1 (Debian) (Debian unstable) >Organization: The Debian Project >Environment: System: Debian GNU/Linux (unstable) Architecture: i686 Configured with: /home/packages/gcc/3.2/gcc-3.2-3.2.1ds5/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux >Description: [ Reported to the Debian BTS as report #141015. Please CC 141015@bugs.debian.org on replies. Log of report can be found at http://bugs.debian.org/141015 ] [ rechecked with gcc-3.2.1 prerelease ] The following program generates a superfluous warning when compiled with -std=c99 or -std=gnu99. ------------------------------------------------------------------------ #include int main (void) __attribute__ ((noreturn)); int main (void) { exit(1); } ------------------------------------------------------------------------ volition:~/tmp$ gcc-3.0 -std=c99 -c test.c test.c: In function `main': test.c:6: warning: function declared `noreturn' has a `return' statement volition:~/tmp$ ------------------------------------------------------------------------ Obviously, this warning is bogus since there is no return statement anywhere in the program :> The warning is not produced by gcc 2.95.4 nor in the default -std=gnu89 mode. Although this example is trivial, I encountered the bug in an actual program that depends on -std=gnu99 (since C99 features are used). In the program, main() starts an event loop which never directly returns; the program exits by calling exit(). >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: