c/8609: Superfluous warning when -std=c99/gnu99 and noreturn on main()

Wolfgang Bangerth bangerth@ticam.utexas.edu
Mon Nov 25 00:46:00 GMT 2002


The following reply was made to PR c/8609; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Agthorr <agthorr@barsoom.org>
Cc: bangerth@dealii.org, <141015@bugs.debian.org>, <gcc-bugs@gcc.gnu.org>,
   <gcc-prs@gcc.gnu.org>, <nobody@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
Subject: Re: c/8609: Superfluous warning when -std=c99/gnu99 and noreturn on
 main()
Date: Mon, 18 Nov 2002 18:04:56 -0600 (CST)

 On Mon, 18 Nov 2002, Agthorr wrote:
 
 > Well, I also compile with -Wmissing-noreturn.  If I add the noreturn
 > attribute to main, gcc complains that the function returns.  If I
 > remove the noreturn, gcc complains that the function does not return.
 > 
 > gcc can't have it both ways. ;)
 
 However, if I remove the noreturn attribute line, I cannot make gcc 
 complain about the code:
 tmp/g> cat x.c
 #include <stdlib.h>
 
 int main (void)
 {
         exit(1);
 }
 tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/gcc -Wmissing-noreturn -std=gnu99 -c x.c
 tmp/g>
 
 What do you do differently?
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 



More information about the Gcc-prs mailing list