Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!att!cbnewsl!dfp From: dfp@cbnewsl.ATT.COM (david.f.prosser) Newsgroups: comp.std.c Subject: Re: Reserved names in ANSI C Message-ID: <875@cbnewsl.ATT.COM> Date: 21 Jun 89 13:34:03 GMT References: <13680@haddock.ima.isc.com> <1598@cbnewsh.ATT.COM> Reply-To: dfp@cbnewsl.ATT.COM (david.f.prosser) Organization: AT&T Bell Laboratories Lines: 23 In article <1598@cbnewsh.ATT.COM> ka@hulk.att.com writes: >karl@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? > Kenneth Almquist Section 4.1.2.1 of the pANS goes into some detail about what is reserved in varying circumstances, but the best rule of thumb is to keep away from names that begin with _ and remember that the following patterns (egrep-type meta-characters) are also reserved: macros E[0-9A-Z][_0-9a-zA-Z]* functions (is|to)[a-z][_0-9a-zA-Z]* macros LC_[A-Z][_0-9a-zA-Z]* functions "existing functions"[fl] macros (SIG|SIG_)[A-Z][_0-9a-zA-Z]* functions str[a-z][_0-9a-zA-Z]* functions (str|mem|wcs)[a-z][_0-9a-zA-Z]* Dave Prosser ...not an official X3J11 answer...