This is the mail archive of the
mailing list for the GCC project.
Re: GCC rejecting (I think) valid code
Andreas Schwab wrote:
There is more to C than the syntax. The standard also contains semantic
constraints that are to be applied on top of the syntax. I can't check
C89, but in C99 section 6.7.2 contains an exhaustive list of allowed
type-specifier sets in a type-name, and this list only allows a single
typedef-name not mixed with other type-specifiers for each type-name.
and that certainly makes sense, because the idea of typedef is to
abstract type names, and using unsigned with a general typedef name
makes no sense unless you think of typedef as simple macro substitution,
but that's not how typedef is defined (as someone said earlier, if you
want simple macro substitution, use #define!)