Is typedef char BUFFER[20] legal?

Henry Spencer henry at zoo.toronto.edu
Wed Jan 30 08:01:00 AEST 1991


In article <1212 at tredysvr.Tredydev.Unisys.COM> paul at tredysvr.Tredydev.Unisys.COM (Paul Siu) writes:
>Is the following statements legal in K&R C, and ANSI C?
>     typedef char BUFFER[20];

Yes.

>... is this going to break when the program is ported?

There is probably some old compiler somewhere that will balk.  It's
impossible to avoid that.  (Geoff Collyer and I could tell you some
stories about compilers vs. C News...)

>Can anyone also tell me what is the most common style convention for type
>names, I usually put them all in capitals.

Insofar as there is a consensus, it's to put them in lower case with a
suffix "_t", e.g. "uid_t" as the type for userids.
-- 
If the Space Shuttle was the answer,   | Henry Spencer at U of Toronto Zoology
what was the question?                 |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list