C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

H c99 Full Support
The TNS, TNS/R, and TNS/E Compilers all conform to the 1989 ANSI C Standard. The C Standard
itself was updated in 1999 and is commonly referred to as “c99”. For H06.08 and later H-series
RVUs and J06.03 and later J-series RVUs, the TNS/E C Compiler and TNS/E C Standard library
support a selected subset of new features that were added by the 1999 standard. This subset is
available when you use the C99LITE pragma and are described in “c99 Selected Features
(C99LITE)” (page 457).
For H06.21 and later H-series RVUs and J06.10 and later J-series RVUs, Full support for the c99
standard is available for TNS/E native applications:
Full support is only provided for programs using IEEE floating point format. Complex types
and several new math functions and macros are not supported for Tandem floating point
format. However, all other c99 features are available when compiled using the Tandem
floating point format option. These features are supported only by the TNS/E native C compiler;
they are not supported by the TNS C, TNS/R C, or C++ compilers.
Support for embedded SQL/MX, but not SQL/MP is available with c99.
The VERSION1 and VERSION2 pragmas are not supported.
If your application maintains common source for TNS- or TNS/R-targeted compilations, HP
recommends that you protect the usage of c99 features by conditional compilation within #if or
#ifdef statements. Applications that use any of the new runtime library features (described in
Chapter 7 of the standard) will not run on systems running H06.20 or earlier H-series RVUs or
J06.09 or earlier J-series RVUs.
Support for the 1989 C Standard and set of features enabled by using the C99LITE pragma are
still provided for the c89 compiler utility.
This appendix is not intended to replicate the ISO/IEC 9899:1999 standard. For detailed
information about c99 features, see the standard document.
Enabling C99
To enable c99 support:
When compiling on Guardian, use the C99 option of the CCOMP command to enable
compiling to the 1999 standard (for example CCOMP/ in filec/;c99. The default is to
compile according to the 1989 standard.
When compiling on OSS and Windows, use c89 to compile using the 1989 standard or use
c99 to compile using the 1999 standard.
Compiler Utility Differences
Most of the options supported by the c99 compiler utility are identical to c89 options. There are
a few differences:
The flag to specify optimization level is different. For c89, the flag is: -Woptimize=n. For
c99, the flag is: -On. For both, n specifies the optimization level, and must be one of 0, 1,
or 2.
Support for c99 is available for TNS/E-targeted compilations only, so flags that apply to
TNS/R compilations, such as -Wtarget=mips and -Wtarget=tns/r, are not supported
by the c99 utility.
None of the -Wsql flags for SQL/MP are supported by c99.
The c99 utility does not support the -Wc99lite flag.
The c99 utility does not support the -Wversion2, -Wversion1, or -Wmigration_check
flags.
The c99 utility does not support the -Wkr flag.
Enabling C99 461