public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8754: Allows illegal code
@ 2002-12-04 7:36 Phil Edwards
0 siblings, 0 replies; 4+ messages in thread
From: Phil Edwards @ 2002-12-04 7:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/8754; it has been noted by GNATS.
From: Phil Edwards <phil@jaj.com>
To: Petter Reinholdtsen <pere@hungry.com>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/8754: Allows illegal code
@ 2003-01-11 14:36 Petter Reinholdtsen
0 siblings, 0 replies; 4+ messages in thread
From: Petter Reinholdtsen @ 2003-01-11 14:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/8754; it has been noted by GNATS.
>From pere@hungry.com Mon Jan 13 00:58:04 2003
From: Petter Reinholdtsen <pere@hungry.com>
To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c/8754: Allows illegal code
Date: 11 Jan 2003 15:31:51 +0100
[Phil Edwards]
> > 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
I meant by default, like without any warning flags (gcc c.c).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/8754: Allows illegal code
@ 2002-12-04 4:46 Nathan Sidwell
0 siblings, 0 replies; 4+ messages in thread
From: Nathan Sidwell @ 2002-12-04 4:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/8754; it has been noted by GNATS.
From: Nathan Sidwell <nathan@codesourcery.com>
To: Petter Reinholdtsen <pere@hungry.com>
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, 04 Dec 2002 12:44:04 +0000
Petter Reinholdtsen wrote:
> Could I request a warning by default in the case above, about the
> variable (or local function) hiding the symbol for the current
> function?
-Wshadow
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/8754: Allows illegal code
@ 2002-12-04 4:26 Petter Reinholdtsen
0 siblings, 0 replies; 4+ messages in thread
From: Petter Reinholdtsen @ 2002-12-04 4:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/8754; it has been noted by GNATS.
From: Petter Reinholdtsen <pere@hungry.com>
To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c/8754: Allows illegal code
Date: 04 Dec 2002 13:21:18 +0100
[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?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-11 14:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-04 7:36 c/8754: Allows illegal code Phil Edwards
-- strict thread matches above, loose matches on Subject: below --
2003-01-11 14:36 Petter Reinholdtsen
2002-12-04 4:46 Nathan Sidwell
2002-12-04 4:26 Petter Reinholdtsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).