Newsgroups: comp.std.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: Pointers to Incomplete Types in Prototypes Message-ID: <1991May5.005738.15063@zoo.toronto.edu> Date: Sun, 5 May 1991 00:57:38 GMT References: <700@taumet.com> <683g+p#@rpi.edu> <709@taumet.com> <12818@dog.ee.lbl.gov> Organization: U of Toronto Zoology In article <12818@dog.ee.lbl.gov> torek@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@zoo.toronto.edu utzoo!henry