3.[234] PATCH: Update predefines for Tru64 UNIX

Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Fri Apr 4 18:05:00 GMT 2003

Dave Love writes:

> Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> writes:
> > * cc defines SYSTYPE_BSD with -std0 and _SYSTYPE_BSD unconditionally.  gcc
> >   also defines __SYSTYPE_BSD and __SYSTYPE_BSD__.  I've left this alone for
> >   the moment.
> I must have missed that.  I think gcc should define them too.

You got that backwards: both Compaq C and gcc define _SYSTYPE_BSD (and
SYSTYPE_BSD if appropriate).  Beyond that, gcc also defines __SYSTYPE_BSD
and __SYSTYPE_BSD__.  This is an artefact of how the predefines are handled
and should be removed.

> > * cc defines __ALPHA and __Alpha_AXP.  The former is not documented in
> >   cc(1) and only used as an alternative to __alpha__ in the system
> >   headers.  The latter is neither documented nor used anywhere in the
> >   system headers.  Therefore I chose to omit them for gcc.
> But I think __ALPHA missing was actually the issue for what I tried to
> compile.  I don't see any good reason to leave them out, and __ALPHA
> is at least shown in an example in cc(1) in Compaq C V6.5-207.  The
> fact that the system headers don't use things and they're not
> documented doesn't mean that user code doesn't use them.

On the contrary: I've just looked up additional Compaq C documentation for
predefines (beyond cc(1)) and found the following:


Table B-2 clearly states that __ALPHA and __Alpha_AXP are defined on
OpenVMS/Alpha only.  The fact that cc defines them contrary to it's own
documentation shouldn't encourage gcc to do the same.  We shouldn't
encourage users to use macros other than those documented by the vendor (or
as gcc extension if strictly necessary, but this seems not to be the case
here since __alpha is fine).

This is the first time in the 10 years we're using alpha systems that I've
heard about __ALPHA and __Alpha_AXP, and given the porting work we have
done in that time, this seems a strong indication that they aren't necessary.

> > * cc defines __PRAGMA_ENVIRONMENT and __IEEE_FLOAT.  Both are only used in
> >   the vendor C++ headers and not documented.  Nothing to do for gcc.
> I guess that __PRAGMA_ENVIRONMENT shouldn't be defined, but I now
> think __IEEE_FLOAT should be.  I realize I used it in old code, still
> in production, written for DEC C, to distinguish Alpha using IEEE and
> VAX number formats.  As far as I know on OSF^WDU^WTru64 you can only
> have IEEE, but __IEEE_FLOAT should be defined in case of code which
> does something like this:
> #ifdef __alpha
> #  if __IEEE_FLOAT == 1
> #  else
> #    define NATIVEFT DFNTF_VAX
> #  endif
> [I think it's beside the point whether or not it will work on other
> Alpha systems.]

Again, the above shows this is only an OpenVMS/Alpha thing, but I could be
persuaded to add it since it seems to go naturally with __X_FLOAT.


More information about the Gcc-patches mailing list