This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/8754: Allows illegal code
- From: Phil Edwards <phil at jaj dot com>
- To: Petter Reinholdtsen <pere at hungry dot com>
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Wed, 4 Dec 2002 11:22:11 -0500
- Subject: Re: c/8754: Allows illegal code
- References: <200211291522.QAA51141@numa6.igpm.rwth-aachen.de> <2flptsi2cw1.fsf@saruman.uio.no>
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