From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2731 invoked by alias); 4 Dec 2002 15:36:02 -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 2700 invoked by uid 71); 4 Dec 2002 15:36:01 -0000 Date: Wed, 04 Dec 2002 07:36:00 -0000 Message-ID: <20021204153601.2699.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Phil Edwards Subject: Re: c/8754: Allows illegal code Reply-To: Phil Edwards X-SW-Source: 2002-12/txt/msg00212.txt.bz2 List-Id: The following reply was made to PR c/8754; it has been noted by GNATS. From: Phil Edwards To: Petter Reinholdtsen Cc: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c/8754: Allows illegal code Date: Wed, 4 Dec 2002 11:22:11 -0500 On Wed, Dec 04, 2002 at 01:21:18PM +0100, Petter Reinholdtsen wrote: > > int main() > > { > > double main=3; > > return main; > > } > > OK. So GCC is not an ANSI C compiler by default. I would like it to > be, but I realise the GCC developers do not want that at the moment. I don't believe ANSI/SIO rules have anything to do with this. > Could I request a warning by default in the case above, about the > variable (or local function) hiding the symbol for the current > function? It's already there: fenric 8% gcc c.c -Wall c.c: In function `main': c.c:4: warning: `main' is usually a function fenric 9% -- I would therefore like to posit that computing's central challenge, viz. "How not to make a mess of it," has /not/ been met. - Edsger Dijkstra, 1930-2002