Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ames!mindcraft.com!mindcraft.com!fred From: fred@mindcraft.com (Fred Zlotnick) Newsgroups: comp.lang.c Subject: typedef names (was: Is typedef char BUFFER[20] legal?) Keywords: POSIX, reserved namespace Message-ID: <665344102.6268@mindcraft.com> Date: 31 Jan 91 17:48:19 GMT References: <1212@tredysvr.Tredydev.Unisys.COM> <1991Jan29.210100.8105@zoo.toronto.edu> Sender: fred@mindcraft.com (Fred Zlotnick) Organization: Mindcraft, Inc. Lines: 31 In article <1991Jan29.210100.8105@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <1212@tredysvr.Tredydev.Unisys.COM> paul@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 fred@mindcraft.com | #include ...!{decwrl,ames,hpda}!mindcrf!fred | -- Fred Zlotnick | #include fred@mindcraft.com | #include ...!{decwrl,ames,hpda}!mindcrf!fred |