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

13 Compiler Pragmas
Compiler pragmas enable you to control various elements of compiler listings, code generation,
and building of the object file.
Specify pragmas in these ways, using the method that is appropriate to the compiler and platform
you are using:
In the TACL RUN command that you enter to run the native C and C++ compilers, the TNS C
compiler, and Cfront
In the G-series TNS c89 utility accompanied by a -Wccom flag
In the native c89 or c99 utility accompanied by a flag that corresponds to the pragma (For
descriptions of the individual flags, see the c89(1) or c99(1) reference page either online
or in the Open System Services Shell and Utilities Reference Manual.)
In TDS on the PC, typically by selecting from the Options|Project|Compiler General Options
page.
For ETK, the pragmas are set at the project level "Configuration Dependent Properties". It can
be accessed within the project properties dialog at the location "Configuration
Properties->C/++".
In addition, some pragmas can be specified in the source file itself. Descriptions of the pragmas
in this section describe the methods for specifying each pragma. In most cases, pragmas in the
source file take precedence over the pragmas in the RUN command or specified to the c89 or
c99 utility. For more details, see the individual pragma descriptions.
The compiler version and SYSTYPE setting determine the default values of pragmas. The compilers
in the Guardian environment default to SYSTYPE GUARDIAN. The compilers in the OSS environment,
which are invoked through the c89 utility or the c99 utility, default to SYSTYPE OSS. For more
details, see SYSTYPE (page 250)
Table 28 summarizes the compiler pragmas. Complete descriptions of each pragma follow Table 28:
Compiler Pragma Descriptions.
Table 28 Compiler Pragma Descriptions
PurposePragma
Directs the native mode C compiler to allow the use of comments
entered in the style of the C++ language.
ALLOW_CPLUSPLUS_COMMENTS
Specifies an extern to be applied to an explicit template instantiation.ALLOW_EXTERN_EXPLICIT_INSTANTIATION
Directs the TNS C compiler to perform strict syntax checking for
compliance to the ISO/ANSI C standard.
ANSICOMPLY
Specifies that Guardian files created by the program, including the
standard files (standard input, standard output, and standard error),
are odd-unstructured disk files with a file code of 180.
ANSISTREAMS
Specifies that when the executable object program is run, only the
base part of the source file name is included in the raw data file.
BASENAME
This option is intended for use only with the PROFGEN option and
is supported only by the TNS/E native compilers.
Directs the compiler to accept bitfields larger than 32-bits or whether
types other than ints can be used as BITFIELD CONTAINER.
BITFIELD_CONTAINER
Directs the TNS/E native compilers to create a C++ library using
only those definitions common to the VERSION2 and VERSION3
libraries and to set the CPPNEUTRAL flag in the linkfile.
BUILD_NEUTRAL_LIBRARY
166 Compiler Pragmas