Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.std.c Subject: Re: scope of actual parameters Message-ID: <8938@june.cs.washington.edu> Date: 7 Aug 89 15:04:19 GMT References: <8936@june.cs.washington.edu> Reply-To: pardo@uw-june.cs.washington.edu (David Keppel) Organization: University of Washington, Computer Science, Seattle Lines: 30 This is a summary of responses. pardo@june.cs.washington.edu (David Keppel) writes: | My *impression* is that actual parameter names are local to the | function. My dpANS-compliant compiler (gcc version 1.34) complains on | the following program: | | typedef int foo; | m (foo){} | | foo.c: parameter name omitted The most illuminating comment was Roger Critchlow: | It's compliant. There is an ambiguity in the grammar at the point | where m (foo has been read. The compiler wants to know whether it | has read the first identifier in an old style function declaration | or the type-name of the first parameter in a prototype style function | declarator. Rather than forcing the compiler to look ahead further | to disambiguate, the standard says that a type-name is a type-name | in this context. Thanks to all who responeded (and those who have yet to respond :-) Fooey on inews for rejecting my article the first time, just because I was trying to show what was quoted text. ;-D on ( The great plains: Farm all parameters ) Pardo -- pardo@cs.washington.edu {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo