[comp.lang.c] Ansi C -- no system-specific pre-#defines

minow@thundr.dec.com (Martin Minow THUNDR::MINOW ML3-5/U26 223-9922) (12/26/87)

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.

Martin Minow
minow%thundr.dec@decwrl.dec.com
decvax!decwrl!dec-rhea!dec-thundr!minow

rbutterworth@watmath.waterloo.edu (Ray Butterworth) (12/29/87)

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.

gwyn@brl-smoke.ARPA (Doug Gwyn ) (01/06/88)

In article <8712260015.AA01517@decwrl.dec.com> minow@thundr.dec.com (Martin Minow THUNDR::MINOW ML3-5/U26 223-9922) writes:
>>be replaced by a compiler-specific _noalias keyword and a user writing
>Unfortunately, the Ansi committee doesn't seem to allow vendor-specific
>pre-defined variables.

Sure it does, so long as they start with an underscore (and, if they are
not external identifiers, followed by either an underscore or a capital
letter).  See section 4.1.2.