Pointers to Incomplete Types in Prototypes

Henry Spencer henry at zoo.toronto.edu
Sun May 5 10:57:38 AEST 1991


In article <12818 at dog.ee.lbl.gov> torek at elf.ee.lbl.gov (Chris Torek) writes:
>	f(p) char *p; { int p = 3; ... }
>
>is legal (if a bit peculiar).

3.7.1, footnote 81:  "A parameter is in effect declared at the head of the
compound statement that constitutes the function body, and therefore may
not be redeclared in the function body (except in an enclosed block)."
This isn't exactly obvious from 3.7.1, but a careful reading of the scope
rules in 3.1.2.1 confirms it:  a function definition sets up *one* scope,
not two, for variables.
-- 
And the bean-counter replied,           | Henry Spencer @ U of Toronto Zoology
"beans are more important".             |  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.std.c mailing list