Conventions

Typographical conventions

The following table explains the typographical conventions used in the IBM® XL C/C++ for AIX®, V11.1 information.

Table 1. Typographical conventions
Typeface Indicates Example
bold Lowercase commands, executable names, compiler options, and directives. The compiler provides basic invocation commands, xlc and xlC (xlc++), along with several other compiler invocation commands to support various C/C++ language levels and compilation environments.
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.
underlining The default setting of a parameter of a compiler option or directive. nomaf | maf
monospace Programming keywords and library functions, compiler builtins, examples of program code, command strings, or user-defined names. To compile and optimize myprogram.c, enter: xlc myprogram.c -O3.

Qualifying elements (icons)

Most features described in this information apply to both C and C++ languages. In descriptions of language elements where a feature is exclusive to one language, or where functionality differs between languages, this information uses icons to delineate segments of text as follows:

Table 2. Qualifying elements
Qualifier/Icon Meaning
C only, or C only begins
C only begins
C only ends
C only ends
The text describes a feature that is supported in the C language only; or describes behavior that is specific to the C language.
C++ only, or C++ only begins
C++ only begins
C++ only ends
C++ only ends
The text describes a feature that is supported in the C++ language only; or describes behavior that is specific to the C++ language.
IBM extension begins
IBM extension begins
IBM extension ends
IBM extension ends
The text describes a feature that is an IBM extension to the standard language specifications.
C++0x, or C++0x begins
C++0x begins
C++0x ends
C++0x ends
The text describes a feature that is introduced into standard C++ as part of C++0x.

Syntax diagrams

Throughout this information, diagrams illustrate XL C/C++ syntax. This section will help you to interpret and use those diagrams.

Sample syntax diagram

The following syntax diagram example shows the syntax for the #pragma comment directive.
Read syntax diagramSkip visual syntax diagram
    (1)    (2)         (3)          (4)    (5)                                                                (9) (10)   
>>-------#------pragma------comment------(------+-compiler-----------------------------------------------+--)----------><
                                                +-date---------------------------------------------------+               
                                                +-timestamp----------------------------------------------+               
                                                |               (6)                                      |               
                                                '-+-copyright-+------+---------------------------------+-'               
                                                  '-user------'      |   (7)                       (8) |                 
                                                                     '-,------"--token_sequence--"-----'                 

Notes:
  1. This is the start of the syntax diagram.
  2. The symbol # must appear first.
  3. The keyword pragma must appear following the # symbol.
  4. The name of the pragma comment must appear following the keyword pragma.
  5. An opening parenthesis must be present.
  6. The comment type must be entered only as one of the types indicated: compiler, date, timestamp, copyright, or user.
  7. A comma must appear between the comment type copyright or user, and an optional character string.
  8. A character string must follow the comma. The character string must be enclosed in double quotation marks.
  9. A closing parenthesis is required.
  10. This is the end of the syntax diagram.
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")  

Examples in this information

The examples in this information, 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 examples for installation information are labelled as either Example or Basic example. Basic examples are intended to document a procedure as it would be performed during a basic, or default, installation; these need little or no modification.