DEC C/C++


Description

The C and C++ compilers on Digital UNIX, Tru64, ULTRIX, and VMS.

The ULTRIX C compiler is essentially the same as the BSD C compiler (pcc) and thus has no version macro, you must look out for the ultrix macro.

Macros

TypeMacroFormatFlag(s)Description
Identification__DECC  C compiler
Version__DECC_VERVVRRTPPPP(or -std -std0 -std1 )VV = Version RR = Revision T = Type (9 = official) PPPP = Patch
Identification__DECCXX  C++ compiler
Version__DECCXX_VERVVRRTPPPP(or -std -std0 -std1 )VV = Version RR = Revision T = Type (9 = official) PPPP = Patch
Identification__VAXC  VAX C compiler
IdentificationVAXC  VAX C compiler
IdentificationVAX11C  VAX C compiler on a VAX-11 or newer

Examples

Version__DECC_VER
5.8-00950890009
6.0-00160090001

Notes

With OSF/1 you really want to be using the -std1 and -isoc94 compiler flags at all times.

The -isoc94 compiler flag will make __STDC__ available, and the -std and -std1 flags will make __STDC_VERSION__ available.

On ULTRIX it will be worth including sys/ansi_compat.h too so that preprocessor symbols are on a par with those on OSF/1. I am not sure if they will be similar to those on VMS.

Example code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <sys/ansi_compat.h>

int
main()
{
#if defined(__DECC)
  printf("DEC C compiler\n");
#elif defined(__DECCXX)
  printf("DEC C++ compiler\n");
#elif defined(__VAXC)
  printf("VAX C compiler\n");
#elif defined(__VAX11C)
  /* I'd assume this is for ULTRIX on the VAX-11. */
  printf("VAX-11 C compiler\n");
#else
# if defined(__ultrix)
  printf("ULTRIX C compiler\n");
# endif
#else
  printf("Unknown C compiler\n");
#endif
}
 
 
Return to top
 
Created: