Subject: Re: bogus CC warning?
To: Krister Walfridsson <cato@df.lth.se>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: tech-toolchain
Date: 04/11/1999 15:06:27
> To go back to the original program. The differences between it and
> my example above are essentially only the typedef. Section 6.5.6
> (Type definitions) says

>    A typedef declaration does not introduce a new type, only a
>    synonym for the type so specified.

> so I think that the warning is required for the original program
> too, but I'm not a language lawyer...

I used to play language lawyer on comp.std.c, and I'm almost certain your
analysis is correct.

Note that if the array typedef is changed to

typedef struct { unsigned char a[256]; } array;

the program works (or passes the "incompatible pointer type" error messages,
anyway).  Arrays are not first-class objects, and if you want to get tricky
with typedefs, it's best to avoid them.  Program in C++ if you really want to
keep array-indexing syntax when dealing with structs.  ;-)