PCC and typedefs (why it barfs)
Tim Maroney
tim at cmu-cs-k.ARPA
Tue Dec 11 10:54:34 AEST 1984
The reason, incidentally, that PCC can't handle typedef identifiers properly
is that they are recognized by the lexical analysis, not as identifiers, but
as type keywords (like "int", etc.) When a typedef is parsed, the typedef
identifier is stuck in the global symbol table as a special-purpose
identifier, and this is checked by the lexical analysis processing. You
see, declaration parsing is grody to the max in PCC, and there is no rule
which is capable of handling a declaration which neither contains a type
keyword or defaults to int. The reason it has never been fixed is that it
would be quite hard to redesign the declaration parsing and semantics.
The real problem with PCC is that it predates the current version of the
language, and new features were patched in without rhyme or reason....
-=-
Tim Maroney, Carnegie-Mellon University Computation Center
ARPA: Tim.Maroney at CMU-CS-K uucp: seismo!cmu-cs-k!tim
CompuServe: 74176,1360 audio: shout "Hey, Tim!"
"Remember all ye that existence is pure joy; that all the sorrows are
but as shadows; they pass & are done; but there is that which remains."
Liber AL, II:9.
More information about the Comp.lang.c
mailing list