Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Basic principles and general input rules

&pagelevel(5)&pagelevel
  • Executing and modifying compiler statements

    The compiler run is started with the command START-CPLUS-COMPILER and is terminated with END statement. During each compiler run, a number of different compilation and/or linkage runs may be started with appropriate "executing" statements (see "Overview of statements"). These compilation and linkage runs can be controlled by means of MODIFY statements, which must always precede the executing statements to be used. These MODIFY statements remain in effect even after the executing statements have been completed (see the example for details).

  • The operand value *UNCHANGED and default settings of the compiler

    When using the compiler in SDF interactive mode with guidance, the operand value *UNCHANGED is frequently displayed for many operands in the SDF statement menus of the compiler.

    The value *UNCHANGED is an SDF default value that is always used in the current compiler statement (and displayed on the screen) whenever no explicit specification for an operand is made.
    *UNCHANGED simply means that the operand value that was defined with an earlier compiler statement still applies to the operand involved. If no such value was specified in the entire compiler run, e.g. immediately after starting the compiler, *UNCHANGED refers to the default value of the compiler, and this default value remains in effect until some other operand value is specified with a compiler statement. In this manual, all default values of the compiler are underlined in the individual statement description. Some operands have a dynamic default, depending on the language mode. In this case no operand value is underlined.
    The currently applicable operand values for compiler statements can be listed with the SHOW-PROPERTIES statement. In this case, the actual operand value is displayed instead of *UNCHANGED.

  • Aliases

    Most of the compiler statements have aliases, which may be used instead of the names displayed in the guided dialog. These aliases are listed for each statement at the start of the corresponding statement description.

  • Spin-off mechanism

    Executing statements that do not succeed trigger the spin-off mechanism. All statements up to the next STEP are ignored in such cases.

  • Input/Output library elements

    The version specification VERSION=@ is rejected, since this is not a valid value for the LMS version.

Example

/START-CPLUS-COMPILER
//MODIFY-SOURCE-PROPERTIES DEFINE=_OSD_POSIX ——————————————————————————  (1)
//MODIFY-LISTING-PROPERTIES SOURCE=*YES ———————————————————————————————  (2)
//MODIFY-INCLUDE-LIBRARIES STD-INCLUDE-LIBRARY=
  (*STANDARD-LIBRARY, $.SYSLIB.POSIX-HEADER)———————————————————————————  (3)
//COMPILE SOURCE=HELLO1.CC ————————————————————————————————————————————  (4)
//MODIFY-SOURCE-PROPERTIES LANG=*C ————————————————————————————————————  (5)
//COMPILE SOURCE=HELLO2.C —————————————————————————————————————————————  (6)
//END
/

The MODIFY-SOURCE-PROPERTIES statement (1) only sets a define. So the default settings of the compiler, e.g. the latest C++ language mode LANGUAGE=*CPLUSPLUS(MODE=*LATEST, STRICT=*NO), apply to all other operands.

On the first compiliation (4) the preceding MODIFY statements are evaluated, and the following steps are performed as a result:

  • The define _OSD_POSIX is set (1).

  • The header libraries $.SYSLIB.CRTE, $.SYSLIB.CRTE.CXX01 and $.SYSLIB.POSIX-HEADER are searched (3).

  • The source program HELLO1.CC is compiled (4) in the extended C++ 2020 language mode (1) and a source/error listing is output to SYSLST (2).

Before the second compilation (6), the C language mode is set in a new MODIFY-SOURCE-PROPERTIES statement (5). The operands MODE and STRICT are not specified, so they are per default *C(MODE=*LATEST,STRICT=*NO). Apart from this change, all other entries in the earlier MODIFY statements remain in effect when compiling the C source program HELLO2.C. The following steps are performed:

  • The define _OSD_POSIX is set (1).

  • The header libraries $.SYSLIB.CRTE and $.SYSLIB.POSIX-HEADER are searched (3).

  • The source program HELLO2.C is compiled (6) in the extended C11 language mode (5) and a source/error listing is output to SYSLST (2).

Please note that *STANDARD-LIBRARY in (3) is resolved differently in the two compiles. This operand value depends on the language mode. The mapping of that value to a list of libraries is done at the compile statement (4,6), not the statement MODIFY-INCLUDE-LIBRARIES (3).