Reserved names in ANSI C

T. William Wells bill at twwells.com
Wed Jun 21 19:04:28 AEST 1989


In article <1598 at cbnewsh.ATT.COM> ka at hulk.att.com writes:
: karl at haddock.ima.isc.com (Karl Heuer) writes:
: > Technically this is illegal because the str* namespace is reserved...
:
: I know that ANSI C reserves all names that begin with and underscore,
: and I just learned from the above quote that it reserves all names
: beginning with "str".  Are there other names to be avoided as well?

Yes. From reading section 4.13:

	E[0-9A-Z].*     macros in errno.h
	is[a-z].*       externals, ctype.h
	to[a-z].*       externals, ctype.h
	LC_[A-Z].*      macros in locale.h
	<func>f         <func> is any function defined in math.h
	<func>l         <func> is any function defined in math.h
	SIG[A-Z].*      macros in signal.h
	SIG_[A-Z].*     macros in signal.h
	str[a-z].*      externals, stdlib.h and string.h
	mem[a-z].*      externals, string.h
	wcs[a-z].*      externals, string.h

No doubt there are others scattered throughout the spec, but I
haven't the will to go hunting for them.

Can you say "name space pollution"?

Good!

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill at twwells.com



More information about the Comp.std.c mailing list