typedef names (was: Is typedef char BUFFER[20] legal?)
Fred Zlotnick
fred at mindcraft.com
Fri Feb 1 04:48:19 AEST 1991
In article <1991Jan29.210100.8105 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>In article <1212 at tredysvr.Tredydev.Unisys.COM> paul at tredysvr.Tredydev.Unisys.COM (Paul Siu) writes:
> . . .
>>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.
While this has been the consensus, the POSIX.1 standard (ISO/IEC 9945-1:1990,
or IEEE 1003.1-1990 if you prefer) has reserved the "_t" namespace for
the system implementor. (That is, application programs should not use
symbols ending in "_t"). The standard states (clause 2.7.2, lines 804-806):
If any header defined by this part of ISO/IEC 9945 is included,
all symbols with the suffix _t are reserved for use by the
implementation, both before and after the #include directive.
So, if you want your programs to port to POSIX.1 conforming systems, this
convention is no longer ok. I had previously used an "_t" suffix for
typedef names, but have stopped. My current convention is to use "_T"
(and to use lower case letters for the rest of the type name), but I'm
not thrilled with it. Any suggestions?
----
Fred Zlotnick | #include <std.disclaimer>
fred at mindcraft.com | #include <brilliant.quote>
...!{decwrl,ames,hpda}!mindcrf!fred |
--
Fred Zlotnick | #include <std.disclaimer>
fred at mindcraft.com | #include <brilliant.quote>
...!{decwrl,ames,hpda}!mindcrf!fred |
More information about the Comp.lang.c
mailing list