Russell: On C Library Implementation
Russell: On C Library Implementation
Posted Oct 14, 2010 21:29 UTC (Thu) by cpeterso (guest, #305)Parent article: Russell: On C Library Implementation
Theres a standard naming for I know what Im doing low-level alternate functions: the single-underscore prefix (eg. _exit()).But the POSIX 2008 standard says:
... all identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use by the implementation. All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary identifier and tag name spaces.So technically, you would probably be safe if you follow Rusty's advice to never use uppercase letters. But you would still be walking through a POSIX minefield if you use a leading underscore. Consider
#ifndef _MY_HEADER_H_INCLUDED_. I now prefer trailing_ underscores_ for "I know what Im doing" functions.
