Article View: comp.std.c
Article #3862Redeclaring a typedef name as a parameter
From: Paul Long
Date: Fri, 25 Aug 1995 22:41
Date: Fri, 25 Aug 1995 22:41
20 lines
1396 bytes
1396 bytes
When describing K&R1 function definitions, the Standard says in section 6.7.1
that "If the declarator includes an identifier list, ... An identifier
declared as a typedef name shall not be redeclared as a parameter." Since this
is not stated in the context of "ANSI" function definitions (those with a
parameter type list), given
typedef int x;
does this mean that
foo1(int x) { }
is conforming but that
foo2(x) int x; { }
is not conforming? Also, what about
foo3(x) { }
Even though the declaration of x is not explicit (there is, for example, no
"int x;", is this a redeclaration of x as a parameter, in which case this is
also not conforming?
--
Paul Long 45:29:14N 122:48:09W
plong@perf.com http://www.teleport.com/~pciwww/
"Wagging head and tail, the red-tailed fish, unsupported, turns around."
Technical Details
Message-ID:
<41ljiv$1o6@news0.rain.rg.net>Path:
arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenetShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenet From: Paul Long <plong@perf.com> Newsgroups: comp.std.c Subject: Redeclaring a typedef name as a parameter Date: 25 Aug 1995 22:41:34 GMT Organization: Performance Computing Incorporated Message-ID: <41ljiv$1o6@news0.rain.rg.net> NNTP-Posting-Host: yosemite.perf.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.1 sun4c) X-URL: news:comp.std.c?ALL