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

compile-option
modifies compiler operation by specifying a compiler pragma or defining a preprocessor
symbol.
pragma
is any valid command-line compiler pragma.
define identifier [ constant ]
defines identifier as a preprocessor symbol. If identifier is followed by a constant,
identifier is defined as an object-like macro that expands to the given value. define
is equivalent to using the #define preprocessor directive in source text.
undefine identifier
deletes identifier as a preprocessor symbol. Using undefine is equivalent to using the
#undef preprocessor directive in source text.
Usage Guidelines
The compiler accesses source files as text-type logical files. Consequently, the source files you
specify in a module must represent physical file types that the compiler can access as text-type
logical files.
The compiler returns one of these completion codes:
The compilation completed successfully.0
The compilation completed with warnings (but no errors).1
The compilation completed with errors.2
The compiler terminated abnormally as the result of an internal error.3
Examples
1. Directing the compiler to translate the source file ABSC (which contains an entire C++ program),
sending the compiler listing to the device $S.#ABSL, storing the object file under the name
ABSO, and using the default VERSION3 library:
> CPPCOMP /IN absc, OUT $s.#absl/ abso;
2. Disabling the run-time diagnostics that the assert function can issue by defining NDEBUG as
a preprocessor symbol:
> CCOMP /IN appc, OUT $s.#appl/ appo; define NDEBUG
3. Generating an object file for the OSS environment:
> CCOMP /IN filec / fileo; SYSTYPE OSS
4. Generating an executable program from a single module:
> CCOMP /IN filec / fileo; RUNNABLE
5. Generating an executable program composed of the modules mod1c, mod2o, mod3o, and
mod4o:
> CCOMP /IN mod1c / fileo; RUNNABLE, LINKFILE "myfile"
In this example, myfile is a text file containing these names of object files (not source files):
mod2o
mod3o
mod4o
306 Compiling and Linking TNS/E Native C and C++ Programs