Getting Started with XL C/C++ provides a general overview of the XL C/C++ compiler, its more significant features, and how those features can help you improve your software development productivity.
For the benefit of current XL C/C++ users upgrading to this release, Getting Started with XL C/C++ also includes a summary of features that are new or improved for V8.0.
Getting Started with XL C/C++ is intended only to help familiarize you with the compiler. For detailed information on using the XL C/C++ compiler, you will want to refer to other books in the XL C/C++ Advanced Edition V8.0 for Linux library.
Getting Started with XL C/C++ is intended for anyone who plans to work with IBM(R) XL C/C++ Advanced Edition V8.0 for Linux, who is familiar with the Linux(R) operating system, and who has some previous C and C++ programming experience.
If you are new to XL C/C++ , you should view Overview of XL C/C++ features to familiarize yourself with the key features of XL C/C++ and how to begin using it to develop your applications.
If you are already an experienced XL C/C++ user and are now upgrading to the latest release of XL C/C++ , you may want to go directly to What's new for V8.0 to review that latest changes and feature enhancements to the compiler.
The remaining sections of this guide provide a brief overview of basic program development tasks with XL C/C++.
This guide includes these topics:
The following table explains the typographical conventions used in this document.
Typeface | Indicates | Example |
---|---|---|
bold | Commands, executable names, pragma directives, and compiler options. | Use the -qmkshrobj compiler option to create a shared object from the generated object files. |
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, file and directory names, examples of program code, command strings, or user-defined names. | If you call omp_destroy_lock with an uninitialized lock variable, the result of the call is undefined. |
Throughout this document, diagrams illustrate XL C/C++ syntax. This section will help you to interpret and use those diagrams.
You must enter punctuation marks, parentheses, arithmetic operators, and other special characters as part of the syntax.
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.
Diagrams of syntactical units other than complete commands, directives, or statements start with the >--- symbol and end with the ---> symbol.
>>-keyword--required_item--------------------------------------><
>>-keyword--+---------------+---------------------------------->< '-optional_item-'
If you must choose one of the items, one item of the stack is shown on the main path.
>>-keyword--+-required_choice1-+------------------------------->< '-required_choice2-'
If choosing one of the items is optional, the entire stack is shown below the main path.
>>-keyword--+------------------+------------------------------->< +-optional_choice1-+ '-optional_choice2-'
The item that is the default is shown above the main path.
.-default_item---. >>-keyword--+-alternate_item-+---------------------------------><
.-----------------. V | >>-keyword----repeatable_item-+--------------------------------><
A repeat arrow above a stack indicates that you can make more than one choice from the stacked items, or repeat a single choice.
Variables are shown in italicized lowercase letters (for example, identifier). They represent user-supplied names or values.
The following syntax diagram example shows the syntax for the #pragma comment directive.
1 2 3 4 5 6 9 10 >>-#--pragma--comment--(-------compiler---------------------------)->< | | +-----date----------------------------+ | | +-----timestamp-----------------------+ | | +--+--copyright--+--+-----------------+ | | | | +--user-------+ +--,-"characters"-+ 7 8
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")
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.