Typographical conventions
The following table explains the typographical conventions used in this document.
Typeface | Indicates | Example |
---|---|---|
bold | Commands, executable names, compiler options and pragma directives | If you specify -O3, the compiler assumes -qhot=level=0. To prevent all HOT optimizations with -O3, you must specify -qnohot. |
italics | Parameters or variables whose actual names or values are to be supplied by the user. Italics are also used to introduce new terms | Make sure that you update the size parameter if you return more than the size requested. |
monospace | Programming keywords and library functions, compiler built-in functions, examples of program code, command strings, or user-defined names | If one or two cases of a switch statement are typically executed much more frequently than other cases, break out those cases by handling them separately before the switch statement. |
UPPERCASE bold | Fortran programming keywords, statements, directives, and intrinsic procedures | The ASSERT directive applies only to the DO loop immediately following the directive, and not to any nested DO loops. |
lowercase bold | Fortran lowercase programming keywords and library functions, compiler intrinsic procedures, file and directory names, examples of program code, command strings, or user-defined names | If you specify -O3, the compiler assumes -qhot=level=0. To prevent all HOT optimizations with -O3, you must specify -qnohot. |
Syntax diagrams
Throughout this document, diagrams illustrate XL C/C++ or XL Fortran syntax. This section will help you to interpret and use those diagrams.
The >>--- symbol indicates the beginning of a command, directive, or statement.
The ---> symbol indicates that the command, directive, or statement syntax is continued on the next line.
The >--- symbol indicates that a command, directive, or statement is continued from the previous line.
The --->< symbol indicates the end of a command, directive, or statement.
Fragments, which are diagrams of syntactical units other than complete commands, directives, or statements, start with the |--- symbol and end with the ---| symbol.
IBM XL Fortran extensions are marked by a number in the syntax diagram with an explanatory note immediately following the diagram. Program units, procedures, constructs, interface blocks and derived-type definitions consist of several individual statements. For such items, a box encloses the syntax representation, and individual syntax diagrams show the required order for the equivalent Fortran statements.
>>-keyword--required_argument----------------------------------><
>>-keyword--+-------------------+------------------------------>< '-optional_argument-'
If you must choose one of the items, one item of the stack is shown on the main path.
>>-keyword--+-required_argument1-+----------------------------->< '-required_argument2-'
If choosing one of the items is optional, the entire stack is shown below the main path.
>>-keyword--+--------------------+----------------------------->< +-optional_argument1-+ '-optional_argument2-'
.-,-------------------. V | >>-keyword----repeatable_argument-+----------------------------><
.-default_argument---. >>-keyword--+-alternate_argument-+-----------------------------><
Sample syntax diagrams
The following syntax diagram example shows the syntax for the #pragma comment directive.
(1) (2) (3) (4) (5) .-compiler--------------------------------------------------. (9) (10) >>--------#-------pragma-------comment-------(-------+-date------------------------------------------------------+--)------------>< +-timestamp-------------------------------------------------+ | (6) | '-+-copyright-+-------+-----------------------------------+-' '-user------' | (7) (8) | '-,-------"--token_sequence--"------'
The following examples of the #pragma comment directive are syntactically correct according to the diagram shown above:
#pragma comment(date) #pragma comment(user) #pragma comment(copyright,"This text will appear in the module")
How to read syntax statements
Syntax statements are read from left to right:
Example of a syntax statement
EXAMPLE char_constant {a|b}[c|d]e[,e]... name_list{name_list}...
The following list explains the syntax statement:
Examples
The examples in this document, except where otherwise noted, are coded in a simple style that does not try to conserve storage, check for errors, achieve fast performance, or demonstrate all possible methods to achieve a specific result.
The path names shown in this document assume the default installation path for the XL C/C++ or XL Fortran compiler. By default, the compiler will be installed in the following directory on the selected disk:
You can select a different destination (relocation-path) for the compiler. If you choose a different path, the compiler will be installed in the following directory: