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: Petter Reinholdtsen <pere at hungry dot com>
- To: 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: 04 Dec 2002 13:21:18 +0100
- Subject: Re: c/8754: Allows illegal code
- References: <200211291522.QAA51141@numa6.igpm.rwth-aachen.de>
- Reply-by: Tue, 1 Jan 1801 04:37:40 +1000
[Volker Reichelt]
> This is not overloading. You can do the following (which is also
> accepted by SGI's compiler):
>
> int main()
> {
> double main=3;
> return main;
> }
>
> In your case the identifier main inside the outer function main is a
> function, not a double. That's the only difference.
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.
Could I request a warning by default in the case above, about the
variable (or local function) hiding the symbol for the current
function?