public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8506: 3.3 (1104) disallowing omission of parameters in fn def
@ 2002-11-08 10:36 Christian Ehrhardt
0 siblings, 0 replies; 5+ messages in thread
From: Christian Ehrhardt @ 2002-11-08 10:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/8506; it has been noted by GNATS.
From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
To: jdonner0@earthlink.net
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/8506: 3.3 (1104) disallowing omission of parameters in fn def
Date: Fri, 8 Nov 2002 19:35:28 +0100
On Fri, Nov 08, 2002 at 05:52:24PM -0000, jdonner0@earthlink.net wrote:
> gcc now makes it an error to omit parameter names, eg
>
> int foo(int /* note, omitted parameter name*/){}
> now gives an error.
>
> $ gcc foo.c
> foo.c: In function `foo':
> foo.c:1: error: parameter name omitted
This behaviour seems to be mandated by the standard. 6.9.1[#5] states:
If the declarator includes a parameter type list, the declaration of
each parameter shall include an identifier, except for the special case
of a parameter list consisting of a single parameter of type void, in
which case there shall not be an identifier. No declaration list shall
follow.
regards Christian
--
THAT'S ALL FOLKS!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c/8506: 3.3 (1104) disallowing omission of parameters in fn def
@ 2002-11-08 11:59 pme
0 siblings, 0 replies; 5+ messages in thread
From: pme @ 2002-11-08 11:59 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jdonner0, nobody
Synopsis: 3.3 (1104) disallowing omission of parameters in fn def
State-Changed-From-To: open->closed
State-Changed-By: pme
State-Changed-When: Fri Nov 8 11:59:56 2002
State-Changed-Why:
User error, communicated privately.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8506
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c/8506: 3.3 (1104) disallowing omission of parameters in fn def
@ 2002-11-08 10:16 Richard Earnshaw
0 siblings, 0 replies; 5+ messages in thread
From: Richard Earnshaw @ 2002-11-08 10:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/8506; it has been noted by GNATS.
From: Richard Earnshaw <rearnsha@arm.com>
To: jdonner0@earthlink.net
Cc: gcc-gnats@gcc.gnu.org, Richard.Earnshaw@arm.com
Subject: Re: c/8506: 3.3 (1104) disallowing omission of parameters in fn
def
Date: Fri, 08 Nov 2002 18:13:13 +0000
This is a C++ism. It's not part of C, and I don't believe GCC has ever
allowed this.
R.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c/8506: 3.3 (1104) disallowing omission of parameters in fn def
@ 2002-11-08 10:06 Phil Edwards
0 siblings, 0 replies; 5+ messages in thread
From: Phil Edwards @ 2002-11-08 10:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/8506; it has been noted by GNATS.
From: Phil Edwards <phil@jaj.com>
To: jdonner0@earthlink.net
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/8506: 3.3 (1104) disallowing omission of parameters in fn def
Date: Fri, 8 Nov 2002 13:02:33 -0500
On Fri, Nov 08, 2002 at 05:52:24PM -0000, jdonner0@earthlink.net wrote:
> >Description:
> gcc now makes it an error to omit parameter names, eg
>
> int foo(int /* note, omitted parameter name*/){}
> now gives an error.
>
> $ gcc foo.c
> foo.c: In function `foo':
> foo.c:1: error: parameter name omitted
It's correct C++, but I don't believe it's correct C. Try renaming the
file and running "gcc -c foo.cc" (or .cpp or whatever) instead.
You can always omit the names in declarations, of course, but not
definitions.
Phil
--
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] 5+ messages in thread
* c/8506: 3.3 (1104) disallowing omission of parameters in fn def
@ 2002-11-08 9:56 jdonner0
0 siblings, 0 replies; 5+ messages in thread
From: jdonner0 @ 2002-11-08 9:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 8506
>Category: c
>Synopsis: 3.3 (1104) disallowing omission of parameters in fn def
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Nov 08 09:56:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Jeff Donner
>Release: gcc version 3.3 20021104 (experimental)
>Organization:
>Environment:
cygwin, Win2K
>Description:
gcc now makes it an error to omit parameter names, eg
int foo(int /* note, omitted parameter name*/){}
now gives an error.
$ gcc foo.c
foo.c: In function `foo':
foo.c:1: error: parameter name omitted
I'm not a language lawyer but I know there's scads of code
that uses this as a clean way to show a fn doesn't
actually use its parameters. And I believe it's correct
usage, many other compilers (VC, Borland at least) allow it.
This would break a lot of code. This shouldn't even be
a warning unless it is specifically asked for.
>How-To-Repeat:
gcc foo.c
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foo.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.c"
aW50IGZvbyhpbnQpe30NCg==
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-11-08 19:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-08 10:36 c/8506: 3.3 (1104) disallowing omission of parameters in fn def Christian Ehrhardt
-- strict thread matches above, loose matches on Subject: below --
2002-11-08 11:59 pme
2002-11-08 10:16 Richard Earnshaw
2002-11-08 10:06 Phil Edwards
2002-11-08 9:56 jdonner0
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).