Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ucbcad!ucbvax!cbosgd!clyde!watmath!rbutterworth From: rbutterworth@watmath.waterloo.edu (Ray Butterworth) Newsgroups: comp.lang.c Subject: Re: Ansi C -- no system-specific pre-#defines Message-ID: <16050@watmath.waterloo.edu> Date: 29 Dec 87 14:52:50 GMT References: <8712260015.AA01517@decwrl.dec.com> Organization: U of Waterloo, Ontario Lines: 19 In article <8712260015.AA01517@decwrl.dec.com>, minow@thundr.dec.com (Martin Minow THUNDR::MINOW ML3-5/U26 223-9922) writes: > In a recent posting, watmath!rbutterworth suggests that noalias could > be replaced by a compiler-specific _noalias keyword and a user writing > portable code should addd something like > #if !defined(_XYZ_COMPILER) > # define _noalias /*nothing*/ > #endif > Unfortunately, the Ansi committee doesn't seem to allow vendor-specific > pre-defined variables. I asked specifically for this in my comments > to the November '86 Draft Standard and was rejected. The August '87 > Draft (section 3.8.8) seems somewhat ambiguous in this matter, however. What am I missing? The standard allows the compiler and library maintainers to use any names they like as long as they begin with a leading underscore. User code that uses such leading underscore names is of course non- portable, but in this case it can easily be made portable by the above #define. And all ANSI standard code willl still compile correctly on this compiler since it is guaranteed not to contain the identifier _noalias.