🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6226

Re: Naming

#6226
From: Henry Spencer
Date: Wed, 21 Feb 1990 19:06
36 lines
2055 bytes
In article <MCDANIEL.90Feb20172440@orenda.amara.uucp> mcdaniel@amara.uucp (Tim McDaniel) writes:
>What names are reserved in ANSI C? ...

Unfortunately, there are a whole pile of them, and they don't follow any
particularly regular pattern.  Everything in the ANSI C library is reserved,
modulo some small escape clauses for things like macros if you don't include
the relevant header file(s).  And there are a bunch of reservations for
future expansion, some of which are macros and hence applicable only if
relevant header files are included, some of which are external names and
hence are reserved regardless.  For example, not only are all the function
names in <math.h> reserved, so are those names suffixed by "f" or "l", for
future provision of float and long-double variants.

Over and above the existing C-library names, and the <math.h> extension
reservation, the list is:

	_[_A-Z].*	everywhere for all purposes
	_[a-zA-Z0-9_].*	everywhere as file-scope identifiers and tags
	E[0-9A-Z].*	in <errno.h>
	(is|to)[a-z].*	as external names, and in <ctype.h>
	LC_[A-Z].*	in <locale.h>
	SIG_?[A-Z].*	in <signal.h>
	str[a-z].*	as external names, and in <stdlib.h> or <string.h>
	mem[a-z].*	as external names, and in <string.h>
	wcs[a-z].*	as external names, and in <string.h>

>... How about in the current UNIX
>standardization effort?

POSIX basically goes by the ANSI rules unless you define _POSIX_SOURCE
before including headers, in which case more standard names appear.
Also there are some POSIX-specific headers.  In particular, <sys/types.h>
can define any .*_t name.
-- 
"The N in NFS stands for Not, |     Henry Spencer at U of Toronto Zoology
or Need, or perhaps Nightmare"| uunet!attcan!utzoo!henry henry@zoo.toronto.edu
Technical Details
Message-ID: <1990Feb21.190612.13368@utzoo.uucp>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <MCDANIEL.90Feb20172440@orenda.amara.uucp>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: Naming
Message-ID: <1990Feb21.190612.13368@utzoo.uucp>
Organization: U of Toronto Zoology
References: <MCDANIEL.90Feb20172440@orenda.amara.uucp>
Date: Wed, 21 Feb 90 19:06:12 GMT