ANSI typedef rules

Henry Spencer henry at zoo.toronto.edu
Wed Mar 27 03:08:39 AEST 1991


In article <232 at sojurn.UUCP> rutgers!sci!devon!sojurn!mike (Mike Sangrey) writes:
>"A typedef name shares the same name space as other identifiers declared
>in ordinary declarators..."
>
>Seems to me that 
>
>typedef int stuff;
>stuff stuff;
>
>is fine...

Uh, no, sorry, it's not.  Take a look at that piece of ANSIspeak:  typedefs
are in the same name space as normal identifiers.  Your example is an attempt
to declare the same identifier with two different meanings, which is illegal.
-- 
"[Some people] positively *wish* to     | Henry Spencer @ U of Toronto Zoology
believe ill of the modern world."-R.Peto|  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.lang.c mailing list