Reserved names in ANSI C

Martin Minow minow at mountn.dec.com
Thu Jun 22 04:35:38 AEST 1989


Kenneth Almquist asks what namespace is reserved by Ansi C.

Several people responded with various lexical patterns.  Unfortunately,
none of the Drafts I've seen ever specified the totality of the namespace.
We know that the C keywords and anything beginning with underscore are
reserved, but there does not seem to be a limit on the library namespace.
When I complained about this in one of the public reviews, I was told that
this was for "Posix compliance."

I suspect that the namespace will continue to grow without bound, and the
best you can do to avoid polluting (or being polluted) is to define all
of your variables using some "private" initial sequence:

	extern int	my_private_global_foo;
	static int	my_private_local_bar;

(I have much the same problem on the Macintosh, and define all of my
variables in lower-case with an embedded underscore to avoid Macintosh
system definitions, most of which use mixed case without underscores.)

Martin Minow
minow%thundr.dec at decwrl.dec.com
The above does not represent the position of Digital Equipment Corporation.



More information about the Comp.std.c mailing list