About this document

XL C/C++ Advanced Edition is an optimizing, standards-based, command-line compiler for the Linux operating system running on the PowerPC(R) architecture. The compiler is a professional programming tool for creating and maintaining 32-bit and 64-bit applications in the extended C and C++ programming languages.

This document introduces you to the XL C/C++ compiler. It describes the various compiler invocations and ways to customize the compilation environment and control the compilation process. This document contains descriptions of the types of transformations the compiler can perform, the accepted file types for input and output, categorized summaries of compiler options, and considerations for porting an existing application. This document also provides a brief introduction to optimizing the performance of your applications. The optimizing capabilities of the compiler enable you to exploit the multilayered architecture of the PowerPC processor.

Linux and AIX(R) are complementary operating systems. If you are familiar with IBM C for AIX or VisualAge(R) C++ Professional for AIX, your makefiles can be readily adapted to work on the Linux platform. If you are new to the IBM C and C++ compilers, this document can open a path to improved performance during compile, link, and run time.

This document assumes that you are familiar with the C and C++ programming languages, the Linux operating system, and the bash shell.


Highlighting conventions

Bold
Identifies commands, keywords, and other items whose names are predefined by the system.

Italics
Identify parameters whose actual names or values are to be supplied by the programmer. Italics are also used for the first mention of new terms.

Example
Identifies examples of specific data values, examples of text similar to what you might see displayed, examples of portions of program code, messages from the system, or information that you should actually type.

Examples are intended to be instructional and do not attempt to minimize run time, conserve storage, or check for errors. The examples do not demonstrate all of the possible uses of the language constructs. Some examples are only code fragments and will not compile without additional code.


How to read the syntax diagrams

The following syntax diagram example shows the syntax for the #pragma comment directive. See XL C/C++ Language Reference for information on the #pragma directive.


(1) (2)  (3)  (4)       (5)       (6)                             (9)   (10)
 >>-#--pragma--comment--(-------compiler---------------------------)-><
                          |                                     |
                          +-----date----------------------------+
                          |                                     |
                          +-----timestamp-----------------------+
                          |                                     |
                          +--+--copyright--+--+-----------------+
                             |             |  |                 |
                             +--user-------+  +--,-"characters"-+
 
                                                (7)     (8)

(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")
 
IBM Copyright 2003