IBM Support

Documentation errata for IBM XL C/C++ Enterprise Edition V8.0 for AIX

Preventive Service Planning


Abstract

This page contains correction and additions to the product documentation and README shipped with IBM XL C/C++ Enterprise Edition V8.0 for AIX.

Content

Getting Started
The following corrections and additions apply to Getting Started with IBM XL C/C++ Enterprise Edition V8.0 for AIX.

XL C/C++ output files

The text:

cpp-Preprocessed source files: filename.i

    To create a preprocessed source file, specify the -P option at compilation time. The source files are preprocessed but not compiled. You can also redirect the output from the -E option to generate a preprocessed file that contains #line directives.

Should read:

cpp-Preprocessed source files: filename.i
    To create a preprocessed source file, specify the -P option at compilation time. The source files are preprocessed but not compiled.

Compiler Reference and manual pages
The following corrections/additions apply to the IBM XL C/C++ Enterprise Edition V8.0 for AIX Compiler Reference and manual pages.

Setting environment variables

The following sub-section is missing from the Information center and in the PDF version should read:

Setting environment variables in bsh, ksh, or sh shells
The following statements, either typed at the command line or inserted into a command file script, show how you can set environment variables in the Bourne or Korn shells. Paths shown assume that you are installing the compiler in the default installation location.

LANG=en_US
NLSPATH=/usr/lib/nls/msg/%L/%N
export LANG NLSPATH


Setting other environment variables

The following text should be added:

LIBPATH
    Specifies an alternate directory search path for dynamically linked libraries. Used at run time only.
How to choose a compiler invocation

The following text:

Files with .c suffixes, assuming you have not used the -+ compiler option, are compiled as C language source code when -qlanglvl=ansi is in effect.

should read:

Files with .c suffixes, assuming you have not used the -+ compiler option, are compiled as C language source code by the C compiler, with -qlanglvl=extc89 in effect.

Types of output files

The text:

Preprocessed source files

You can also redirect the output from the -E option to generate a preprocessed file that contains #line directives.



Should be removed. The -E option does not generate a preprocessed file; it only writes preprocessed output to standard output.

The text:

Shared library files
    Shared library files have a .so suffix, for example, my_shrlib.so.

should read:

Shared library files
    If you specify the -qmkshrob option, the compiler generates a single shared library file for all input files. The compiler names the output file shr.o, unless you specify the -o file_name option, and give the file a .so suffix.

Message severity levels and compiler response

The U level should be indicated as C only. It it not used by C++.
    Compiler return codes

    The following text should be added to the table:

    249
      A no-files-specified error has been detected.
    -qalias option

    In the syntax diagram and description, the default for the typeptr suboption should be indicated as notypeptr.

    The text:

    If noallptrs is specified, pointers are never aliased (this also implies -qalias=typeptr).

    should read:

    If allptrs is specified, pointers are never aliased (this also implies -qalias=typeptr).

    The text:

    If notypeptr is specified, pointers to different types are never aliased.

    should read:
    If typeptr is specified, pointers to different types are never aliased.

    -qarch option

    The text:

    ppc This is the default if -q32 is set or implied.
    should read:

    ppc This is the default if -q64 is set or implied.

    -B option

    In the syntax diagram, the programs suboption should be removed. It is not a valid parameter for this option, but only for the -t option.

    -bmaxdata option

    In the syntax diagram and in the examples, the delimiter = (equal sign) should be replaced with : (colon).

    -qcrt option

    The following text should be added:

    Purpose

    Specifies whether system startup files are to be linked. This option can be used in system programming to disable the automatic linking of the startup routines provided by the operating system.

    Syntax


      Read syntax diagramSkip visual syntax diagram .-crt---.
    >>- -q--+-nocrt-+----------------------------------------------><


    Usage

    If the -qnocrt compiler option is specified, the compiler will not use the system startup files at link time. Only the files specified on the command line with the -l flag will be linked.

    -qdbxextra option (C only)

    The following text:

    To minimize the size of object and executable files, the compiler only includes information for symbols that are referenced. Debugging information is not produced for unreferenced arrays, pointers, or file-scope variables unless -qdbxextra is specified.

    Should read:

    To minimize the size of object and executable files, the compiler only includes information for structure, union, and enumeration definitions and typedef declarations. Debugging information is not produced for unreferenced definitions unless -qdbxextra is specified.

    -E option

    The text:

    If used with the -M option, -E will work only for files with a .C, .cpp, .cc (all C++ source files), .c (C source files), or a .i (preprocessed source files) filename suffix.

    Should be removed. The -E option will always work with files with any suffix.

    -qeh option

    In the syntax diagram, v6 should be shown as the default suboption.

    The text:

    If -qeh is specified without any suboption, -qeh=v5 is assumed.

    should read:

    If -qeh is specified without any suboption, -qeh=v6 is assumed.
    -qflag option

    In the syntax diagrams and in the table, the following should be corrected:

    The e suboption should be indicated for C only. It is not supported in C++.
    The u suboption should be removed. It is not a valid suboption in C or C++.

    The text:

    You must specify a minimum message severity level for both listing and terminal reporting.

    Should read:

    (C only) You must specify a minimum message severity level for both listing and terminal reporting.

    (C++ only) You must specify a minimum message severity level for the listing. If you
    do not specify a suboption for the terminal, the compiler assumes the same severity as for the listing.

    -qfuncsect option

    This option is supported in C++ only.

    -g option

    The following text should be removed:

    The default with -g is not to include information about unreferenced symbols in the debugging information. To include information about both referenced and unreferenced symbols, use the -qdbxextra option with -g.

    Should read:

    The default with -g is not to include information about unreferenced structure, union or enumeration definitions, or typedef declarations. in the debugging information. (C only) To include information about both referenced and unreferenced symbols, use the -qdbxextra or -qsymtab=unref option with -g.

    The following text should be removed:

    To compile myprogram.c to produce an executable program named testing_all, and containing additional information about unreferenced symbols so you can debug it, enter:

    xlc myprogram.c -o testing_all -g -qdbxextra



    -qhalt option

    In the syntax diagram, the s suboption should be indicated as the default for both C and C++.

    In the syntax diagrams and in the table, the following should be corrected:

    The e suboption should be indicated for C only. It is not supported in C++.
    The u suboption should be removed. It is not a valid suboption in C or C++.

    -qhaltonmsg option (C++ only)

    In the syntax diagram, the repeat delimiter character should be a colon (:), not a comma.

    The text:

    Additional message numbers must be separated by a comma.

    Should read:

    Additional message numbers must be separated by a colon.

    -qinfo=private suboption
    In the syntax diagram the suboption -qinfo=private has no affect when specified and should be removed. Instead, use the -qreport option to report compiler-driven automatic parallelization cases; user parallelization cases are not reported.

    -qinclude option

    The following text should be added:

    Purpose

    Specifies additional header files that are included before the first line of a source file in a compilation unit and ahead of any headers which may be specified by an #include statement on the first line the source file. The option has been added for portability among supported platforms.

    Syntax

    >>- -qinclude--=--header_file-------------------------------------><

    Parameters

    header_file
      The name of a header file. Unless header_file is fully qualified, the search for it begins in the directory from which the compiler was invoked and continues, as needed, through the user’s #include search chain.

    Usage

    When the option is specified multiple times in an invocation, the header files are included in order of appearance on the command line. If the same header file is specified multiple times with this option, the header will be treated as if included multiple times by #include statements in the source file, in order of appearance on the command line.

    Interaction with other options and pragmas

    The option -qinclude is applied only to the compilations of the files specified when the option is enabled. It is not passed to any compilations that occur during the link step, nor to any implicit compilations, like those invoked by the option -qtemplateregistry, nor to the files generated by -qtempinc.

    Interaction with:Affects:
    -IThe search chain in which a user include file specified by -qinclude is sought includes any additional search paths added to the search chain by the -I option, regardless of whether -qinclude precedes or follows -I on the command line.
    -E, -P Output from these options is as if the user include files specified by -qinclude were added to the first line of the source file in an #include statement.
    -D, -UThe user include files specified by -qinclude are processed after all -D and -U options.
    -M, -qmakedepThe user include file specified by -qinclude will be considered a dependency of the source file if -M or -qmakedep are used to generate information for a make description file.
    -qidirfirst If -qidirfirst is specified, the user include file specified by -qinclude is sought in the directories specified by the -Idirectory option before the directory where the file resides.
    -qstdinc, -qnostdinc If -qstdinc is specified, the user include file specified by -qinclude is sought in the standard include directories; if -qnostdinc is specified, the user include file is not sought in the standard include directories.
    (C++ only) -qtemplateregistryWhen used with -qtemplateregistry, -qinclude is recorded in the templateregistry file, along with the source files affected by it. When these file dependencies initiate recompilation of the templateregistry, the -qinclude option is passed to the dependent files only if it had been specified for them when they were added to the templateregistry.
    pragma directivesAny pragma that must appear before noncommentary statements in a source file is affected because the behavior of -qinclude is as if the statement #include "header_file" were inserted as the first line of the source.

    The option also affects the program source listing file generated by the -qlist option:
    • Each use of the -qinclude option will have a separate entry in the Option section of the listing file.
    • A file included by the -qinclude option will appear in the File Table section of the listing file, as if it had been included by an #include statement.
    • If the option -qsource is used, the header file included through the use of -qinclude will not appear in the source section of the listing. The listing will differ from that produced with the header file included by an #include statement. Use -qshowinc=usr or -qshowinc=all in conjunction with -qsource if you want these header files to appear in the listing.

    Example

    xlc -qinclude=foo1.h foo.c -qinclude=foo2.h -qinclude=foo1.h
    Header file foo1.h is included first, followed by foo2.h, followed by foo1.h.

    -qinline option

    In the syntax diagram and in the description for C, the =threshold keyword should be removed. The correct syntax is simply -qinline=num.

    -L option

    The text:

    If the LIBPATH environment variable is set, the compiler will search for libraries first in directory paths specified by LIBPATH, and then in directory paths specified by the -L compiler option.

    should read:

    When you link shared libraries into an executable, specifying the paths to the libraries with the -L option during the link also embeds the path information in the executable, so the shared libraries can be correctly located at run time. If you do not specify any paths with -L during this link and you additionally prevent the compiler from automatically passing -L arguments to the linker by using the -bnolibpath linker option, only paths that
    are specified by the LIBPATH environment variable are embedded in the executable
    file.

    -qlanglvl option

    The text:

    (C++) [no]c99__func__
      The __C99__FUNC__ macro is defined to be 1 when c99__func__ is in effect, and is undefined otherwise.

    Should read:

    (C++) [no]c99__func__
      The __C99__FUNC__ macro is defined to 1 when -qlanglvl=c99__func__ or -qlanglvl=extended is in effect, and is undefined otherwise.

    -qlargepage option

    The following text:

    This option has effect only on Power 4 systems running AIX v5.1D or later.

    This option is only valid when used together with IPA (-qipa, -O4, -O5 compiler options).



    should read:

    This option has effect only on Power 4 or higher systems.

    Note that this option is only useful in the following conditions:
    • Large pages must be available and configured on the system.
    • You must compile with an option that enables loop optimization, such as -O3 or -qhot.
    • You must link with the -blpdata option.

    -qlib option

    The following text should be added:

    Purpose

    Specifies whether standard system libraries and internal compiler libraries are to be linked. This option can be used in system programming to disable the automatic linking of unneeded libraries.

    Syntax



    .-lib---.
    >>- -q--+-nolib-+----------------------------------------------><

    Usage


    Using -qnolib specifies that no libraries, including the standard C and C++ libraries as well as other libraries used by the compiler (these are found in the lib/aix51/, lib/aix52/, and lib/aix53/ subdirectories of the compiler installation directory), are to be linked. The system startup files are still linked, unless -qnocrt is also specified.

    Note that if your program references any symbols that are defined in the standard libraries or compiler-specific libraries, link errors will occur. To avoid these unresolved references when compiling with -qnolib, be sure to explicitly link the required libraries by using the command flag -l and the library name.

    Example



    To compile myprogram.c without linking to any libraries except the compiler library libxlopt.a, enter:

    xlc myprogram.c -qnolib -lxlopt



    -MF option

    The text:

    If you specify -MF option when compiling multiple source files, only a single dependency file will be generated and it will contain the make rule for the last file specified on the command line.

    Should read:

    If you specify a single file name for the -MF option when compiling multiple source files, only a single dependency file will be generated containing the make rule for the last file specified on the command line.

    -qmkshrobj option

    The text:

    (C++) priority specifies the priority level for the file. priority may be any number from -214782623 (highest priority-initialized first) to 214783647 (lowest priority-initialized last). Numbers from -214783648 to -214782624 are reserved for system use.

    Should read:

    (C++) priority specifies the priority level for the file. priority may be any number from -214782624 (highest priority-initialized first) to 214783647 (lowest priority-initialized last). Numbers from -214783648 to -214782625 are reserved for system use.

    -P option

    The text:

    In extended mode, the preprocessor interprets the backslash character when it is followed by a new-line character as line-continuation in:
    • macro replacement text
    • macro arguments
    • comments that are on the same line as a preprocessor directive.

    Line continuations elsewhere are processed in ANSI mode only.

    Should read:



    The preprocessor interprets the backslash character when it is followed by a new-line character as line-continuation in:
    • macro replacement text
    • macro arguments
    • all comments
    • string literals

    -qpic option

    The text:

    To compile a shared library libmylib.so, use the following command:

    xlc mylib.c -qpic=small -Wl, -shared, -soname="libmylib.so.1" -o libmylib.so.1

    Refer to the ld command in your operating system documentation for more information about the -shared and -soname options.

    Should read:



    To compile a shared library libmylib.so, use the following commands:

    xlc mylib.c -qpic=small -c

    xlc -qmkshrobj mylib.o -o libmylib.so.1



    -qppline option

    The text:

    If the -P option is used, the default is -qnoppline

    This option overrides the behavior of the -E and -P option.

    Should read:



    When the -P option is used, the default is -qnoppline. When the -E option is used, the default is -qppline.

    -qpriority (C++ only)

    The text:

    You can specify a priority level from -(2147483647 + 1) (highest priority) to +2147483647 (lowest priority).

    Should read:
    You can specify a priority level from -2147482624 (highest priority) to +2147483647 (lowest priority).

    -qproclocal, -qprocimported, -qprocunknown options

    In the syntax diagram, the suboptions -qnoproclocal, -qnoprocimported, and -qnoprocunknown should be removed. These are not valid suboptions.

    -qtmplinst option

    The text:

    auto
      If both -qtempinc and -qtemplateregistry are disabled, implicit instantiation will always be performed, otherwise if both or any of the options are enabled, the compiler manages the implicit instantiation using either option which is enabled.


    Should read:

    auto
      If both -qtempinc and -qtemplateregistry are disabled, implicit instantiation will always be performed. Otherwise, if either of these options is enabled, the compiler manages the implicit instantiation according to that option.


    -qrtti option (C++ only)

    In the syntax diagram, the default setting should be nortti (not rtti=all).

    -qsourcetype option

    In the table the following text should be added:


    Source typeSuffixBehavior
    C++i. (for preprocessed files)The compiler compiles all source files following this option as if they are C++ language source files.


    -qsymtab option (C only)

    The following text:

    When you specify the -g option, debugging information is included in the object file. To minimize the size of object and executable files, the compiler only includes information for symbols that are referenced. Debugging information is not produced for unreferenced arrays, pointers, or file-scope variables unless -qsymtab=unref is specified.

    Should read:

    When you specify the -g option, debugging information is included in the object file. To minimize the size of object and executable files, the compiler only includes information for structure, union, and enumeration definitions, and typedef declarations. Debugging information is not produced for unreferenced definitions unless -qsymtab=unref is specified.

    -t option

    The m suboption should be indicated as valid for C++ only.

    -qupconv option ( C only )

    The following text:

    Default

    The default is -qnoupconv, except when -qlanglvl=extc89, in which case the default is -qupconv. The compiler does not preserve the unsigned specification.

    Should read:

    -qnoupconv for all language levels except classic or extended
    -qupconv when the classic or extended language levels are in effect

    -qutf option

    (C++ only) In the syntax diagram, the default should be indicated as -qutf.

    -W option

    The m suboption should be indicated as valid for C++ only.

    Also the following suboption should be added:

    E CreateExportList utility

    -qweakexp option (C++ only)

    The following text should be added:

    Purpose

    Includes or excludes global symbols marked as weak (with the #pragma weak directive) from the export list generated when you create a shared object.

    This option is used only together with the -qmkshrobj or -G options.

    Syntax


      Read syntax diagramSkip visual syntax diagram.-weakexp---.
    >>- -q--+-noweakexp-+------------------------------------------><

    Example

    To compile myprogram.c into a shared object, and prevent weak symbols from being exported, enter:

    xlc myprogram.c -qmkshrobj -qnoweakexp



    -qweaksymbol option

    The text:

    A symbol is marked as weak, when it is only visible within its own compilation unit.

    should be removed.

    -qxref option

    The following text should be added:

    The listing uses the following character codes:

    Character Meaning
    XFunction is declared.
    YFunction is defined.
    Z Function is called.
    $Type is defined, variable is declared/defined.
    #Variable is assigned to.
    &Variable is defined and initialized.
    [blank]Identifier is referenced.

    Acceptable compiler mode and process or architecture combinations

    The following text should be added:

    -qarch optionPredefined macros Default -qtune settingAvailable -qtune settings
    ppc64v_ARCH_COM
    _ARCH_PPC _ARCH_PPC64 _ARCH_PPC64V
    ppc970 auto
    ppc970

    #pragma map

    The syntax diagram should read as follows:

    #pragma map syntax - C

    >>-#--pragma--map--(----identifier----,--"name"--)-------------><

    #pragma map syntax - C++

    >>-#--pragma--map--(--identifier--(--argument_list--)--,--"name"--)-><

    The following text:

    identifier
      A name of a data object or a nonoverloaded function with external linkage. If the identifier is the name of an overloaded function or a member function, there is a risk that the pragma will override the compiler-generated names. This will create problems during linking.

    should read:

    identifier
      The name used in the source code. (C only) The identifier can represent a data object or function with external linkage. (C++ only) The identifier can represent a data object, a non-overloaded or overloaded function, or overloaded operator, with external linkage. If the name to be mapped is not in the global namespace, it must be fully qualified.

      The identifier should be declared in the same compilation unit in which it is referenced, but should not be defined in any other compilation unit.

    The following text:

    function_signature
      A name of a function or operator with internal linkage. The name can be qualified.

    should read:

    (C++ only) argument_list
      The list of arguments for the overloaded function or operator designated by the identifier. If the identifier designates an overloaded function, the function must be parenthesized and must include its argument list if it exists. If the identifier designates a non-overloaded function, only identifier is required, and the parentheses and argument list are optional.

    The following text should be added:

    The name may or may not be declared in the same compilation unit in which the identifier is referenced, but must not be defined in the same compilation unit. Also, the name should not be referenced anywhere in the compilation unit where identifier is referenced.

    Note that in order for a function to be actually mapped, the map target function (name) must have a definition available at link time (from another compilation unit), and the map source function (identifier) must be called in your program.

    The following text should be removed:

    You should not use #pragma map to map the following:
    • C++ member functions
    • Overloaded functions
    • Objects generated from templates

    Example 1 (C only) should read:

    int funcname1(void);
    int func(void);
    #pragma map(func , "funcname1") /* maps func to funcname1 */
    int main()
    {
    return func();
    }

    Example 2 (C++ only) should read:

    extern "C" int funcname1();
    extern "C" int func();
    #pragma map(func , "funcname1") // maps ::func to funcname1
    int main()
    {
    return func();
    }

    Example 3 (C++ only) should read:

    #pragma map(foo, "bar")
    int foo();
    int main()
    {
    return foo();
    }
    extern "C" int bar();

    Example 4 (C++ only) should read:

    #pragma map(foo, "bar__Fv")
    int foo();
    int main()
    {
    return foo();
    }
    extern int bar();

    #pragma namemangling (C++ only)

    The following text should be added:

    v8
      The name mangling scheme is compatible with the GA release of XL C++ V8.0.

    v7
      The name mangling scheme is compatible with the GA release of XL C++ V7.0.

    #pragma namemanglingrule (C++ only)

    The following text:

    fnparmtype, on
      Function arguments are mangled according to function parameter types. For example, cv qualifiers in function arguments are not mangled.

    fnparmtype, off
      Name mangling is compatible with VisualAge C++ V5.0, and cv-qualifiers in function arguments are mangled.

    fnpartmtype, pop
      Discards the current #pragma namemanglingrule setting, and replaces it with the previous #pragma namemanglingrule setting from the stack. If no previous settings remain on the stack, the default #pragma namemanglingrule setting is used.

    should read:

    fnparmtype, on
      Top-level cv-qualifiers are not encoded in the mangled name of a function parameter. Also, top-level cv-qualifiers are ignored when repeated function parameters are compared for equivalence; function parameters that differ only by the use of a top-level cv-qualifier are considered equivalent and are mangled according to the compressed encoding scheme. This setting is compatible with VisualAge C++ V6.0 and higher.

    fnparmtype, off
      Top-level cv-qualifiers are encoded in the mangled name of a function parameter. Also, repeated function parameters that differ by the use of cv-qualifiers are not considered equivalent and are mangled as separate parameters. This setting is compatible with VisualAge C++ V5.0 and earlier.

    fnparmtype, pop
      Discards the current fnparmtype setting, and replaces it with the previous fnparmtype setting from the stack. If no previous settings remain on the stack, the default fnparmtype setting is used.

    The following text:

    The default is #pragma namenanglingrule(fnparmtype, on) when the -qnamemangling=ansi or #pragma namemangling(ansi) compiler options are in effect.

    should read:

    The default is #pragma namenanglingRule(fnparmtype, on) when the name mangling scheme is set to ansi or v6 or higher.

    The following text should be added:

    fnparmscmp, on
      Intermediate-level cv-qualifiers are considered when repeated function parameters are compared for equivalence; repeated function parameters that differ by the use of intermediate-level cv-qualifiers are mangled as separate parameters. This setting is compatible with XL C++ V8.0 and higher.

    fnparmscmp, off
      Intermediate-level cv-qualifiers are ignored when repeated function parameters are compared for equivalence; function parameters that differ only by the use of an intermediate-level cv-qualifier are considered equivalent and are mangled according to the compressed encoding scheme. This setting is compatible with XL C++ V7.0 and earlier.

    fnparmscmp, pop
      Discards the current fnparmscmp setting, and replaces it with the previous fnparmscmp setting from the stack. If no previous settings remain on the stack, the default fnparmscmp setting is used.

    The default for the fnparmscmp parameter is on when the name mangling scheme is set to ansi or v8 or higher. Otherwise, the default is off.

    #pragma object_model (C++ only)

    In the syntax diagram, the suboption gccv3 should be removed; it is not valid. All occurrences of the "compat" suboption should be replaced with "classic".

    #pragma operator_new (C++ only)

    The following text should be added:

    Purpose

    The #pragma operator_new directive determines whether the new and new[] operators throw an exception if the requested memory cannot be allocated.

    Syntax
            Read syntax diagram.-returnsnull-----.
    >>-#--pragma--operator_new--(--+-throwsexception-+--)----------><

    Parameters

    returnsnull
      If the memory requested by the new operator cannot be allocated, the compiler returns 0, the null pointer. Use this option for compatibility with versions of the XL C++ compiler previous to VisualAge C++ V6.0.

    throwsexception
      If the memory requested by the new operator cannot be allocated, the compiler throws a standard exception of type std::bad_alloc. Use this option in new applications, for conformance with the C++ Standard.

    Defaults

    returnsnull

    Usage



    The pragma can be specified only once in a source file. It must appear before any statements in the source file. This pragma takes precedence over the -qlanglvl=newexcp compiler option.

    Restrictions



    This pragma applies only to versions of the new operator that throw exceptions; it does not apply to the nothrow versions of the new operator (for the prototypes of all the new operator versions, see the description of the <new> header in the Standard C++ Library Reference). It also does not apply to class-specific new operators, user-defined new operators, and new operators with placement arguments.

    #pragma priority

    The text:

    The value of n must be an integer literal in the range of INT_MIN to INT_MAX-2147483643 to 2147483647.

    Should read:

    The value of n must be an integer literal in the range of INT_MIN to INT_MAX: -2147482624 to 2147483647.

    #pragma weak

    The following text should be added:

    In order for weak symbols to be generated, you must also ensure that the -qweaksymbol option is in effect (On AIX 5.2 and higher, -qweaksymbol is the default setting. On AIX 5.1, -qnoweaksymbol is the default setting.)

    The following text:

    #pragma weak identifier

    If identifieris defined in the same compilation unit as #pragma weak identifier, identifier is treated as a weak definition. If #pragma weak exists in a compilation unit that does not use or declare identifier, the pragma is accepted and ignored. If the C++ function is a template function, you must explicitly instantiate the template function.

    should read:

    If identifier is referenced from anywhere in the program, the linker will use the "strong" version of the definition (that is, the definition not marked with #pragma weak), if there is one. If there is no strong definition, the linker will use the weak definition; if there are multiple weak definitions, it is unspecified which weak definition the linker will select (typically, it uses the definition found in the first object file specified on the command line during the link step).


    The following text:

    #pragma weak identifier=identifier2

    This form of the pragma defines identifier as a weak global symbol. References to identifier will use the value of identifier2.

    If the C++ function is a template function, you must explicitly instantiate the template function.

    should read:


    This form of the pragma creates a weak definition of the identifier for a given compilation unit, and an alias for identifier2. If identifier is referenced from anywhere in the program, the linker will use the "strong" version of the definition (that is, the definition not marked with #pragma weak), if there is one. If there is no strong definition, the linker will use the weak definition, which resolves to the definition of identifier2. If there are multiple weak definitions, it is unspecified which weak definition the linker will select (typically, it uses the definition found in the first object file specified on the command line during the link step).

    Example 1 should be removed; it is not valid.

    Example 2 should read:

    // Compilation unit 1:

    #include <stdio.h>

    void foo();

    int main()
    {
    foo();
    }

    // Compilation unit 2:

    #include <stdio.h>

    void foo(); // optional

    #if __cplusplus
    #pragma weak foo__Fv = foo1__Fv
    #else
    #pragma weak foo = foo1
    #endif

    void foo1(void)
    {

    printf("Just in function foo1()\n");
    }

    // Compilation unit 3:

    #include <stdio.h>

    void foo()
    {
    printf("Just in function foo()\n");
    }

    If all three compilation units are compiled and linked together, the linker will use the strong definition of foo in compilation unit 3 for the call to foo from compilation unit 1, and the output will be:
    Just in function foo()
    If only compilation unit 1 and 2 are compiled and linked together, the linker will use the weak definition of foo in compilation unit 2, which is an alias for foo1, and the output
    will be:
    Just in function foo1()

    Macros related to the AIX platform

    In the description of __SIZE_TYPE__, the following text:

    On this platform, the macro is defined as long unsigned int.In 32-bit mode, the macro is defined as unsigned int. In 64-bit mode, the macro is defined as long int.

    should read:

    In 32-bit mode, the macro is defined as unsigned int. In 64-bit mode, the macro is defined as unsigned long.

    The following text should be added:

    __LONGDOUBLE64
      Indicates that the long double type is 64 bits in size. This macro is defined to 1 unless the -qldbl128 option is in effect.

    __LONGDOUBLE128
      Indicates that the long double type is 128 bits in size. This macro is defined to 1 when the -qldbl128 option is in effect.

    Macros related to language features

    __IBM_INCLUDE_NEXT is predefined at all language levels in both C and C++.

    Built-in functions

    The following text should be added:

    The compiler supports all vector processing functions defined by the AltiVec
    specification. See the AltiVec Technology Programming Interface Manual for detailed descriptions of all of these built-in functions, available online at http://www.freescale.com/files/32bit/doc/ref_manual/ALTIVECPIM.pdf

    Floating-point built-in functions

    In the description of __setrnd, the text:

    The allowable values for integers are:
    • 0 -- round to zero
    • 1 -- round to nearest
    • 2 -- round to +infinity
    • 3 -- round to -infinity

    Should read:

    The allowable values for the argument are:
    • 0 -- round to nearest
    • 1 -- round to zero
    • 2 -- round to +infinity
    • 3 -- round to -infinity


    Language Reference
    The following corrections and additions apply to the IBM XL C/C++ Enterprise Edition V8.0 for AIX Language Reference.

    Namespaces of identifiers

    The following text:

    No name conflict occurs among the items named student in the following example:

    int get_item()
    {
    struct student /* structure tag */
    {
    char name[20]; /* this structure member may not be named student */
    int section;
    int id;
    } sam; /* this structure variable should not be named student */

    goto student;
    student:; /* null statement label */
    return 0;

    student fred; /* legal struct declaration in C++ */
    }

    The compiler interprets each occurrence of student by its context in the program. For example, when student appears after the keyword struct, it is a structure tag. The name student may not be used for a structure member of struct student. When student appears after the goto statement, the compiler passes control to the null statement label. In other contexts, the identifier student refers to the structure variable.

    should read:



    No name conflict occurs among the items named student in the following example:

    int get_item()
    {
    struct student /* structure tag */
    {
    char student[20]; /* structure member */
    int section;
    int id;
    } student; /* structure variable */

    goto student;
    student:; /* null statement label */

    return 0;
    }

    The compiler interprets each occurrence of student by its context in the program:
    when student appears after the keyword struct, it is a structure tag; when it
    appears in the block defining the student type, it is a structure member variable;
    when it appears at the end of the structure definition, it declares a structure
    variable; and when it appears after the goto statement, it is a label.

    Character types

    The text:

    By default, char behaves like an signed char.

    Should read:

    By default, char behaves like an unsigned char.

    The weak variable attribute

    The following text should be added:

    In order for weak symbols to be generated, you must also ensure that the -qweaksymbol option is in effect (On AIX 5.2 and higher, -qweaksymbol is the default setting. On AIX 5.1, -qnoweaksymbol is the default setting.)

    Unary operators

    The following text should be added:

    The vec_step operator

    The vec_step operator takes a vector type argument and returns
    an integer value representing the amount by which a pointer to a vector element
    should be incremented to move by 16 bytes. For complete documentation of this
    operator, see the AltiVec Technology Programming Interface Manual, available at
    http://www.freescale.com/files/32bit/doc/ref_manual/ALTIVECPIM.pdf

    The weak function attribute

    The following text should be added:

    In order for weak symbols to be generated, you must also ensure that the -qweaksymbol option is in effect (On AIX 5.2 and higher, -qweaksymbol is the default setting. On AIX 5.1, -qnoweaksymbol is the default setting.)

    Pass by value

    The C example should read as follows:

    #include <stdio.h>
    void swapnum(int *i, int *j) {
    int temp = *i;
    *i = *j;
    *j = temp;
    }

    int main(void) {
    int a = 10;
    int b = 20;
    swapnum(&a, &b);
    printf("A is %d and B is %d\n", a, b);
    return 0;
    }

    Standard predefined macro names

    In the descriptions of __STDC_VERSION__ and __STDC_HOSTED__, the following text should be added:

    This macro is only defined if __STDC__ is defined.

    The IBM XL C language extensions

    The #include_next preprocessor directive is now enabled by default at all language levels.

    The IBM XL C++ language extensions

    The #include_next preprocessor directive is now enabled by default at all language levels.


    Programming Guide and manual pages
    The following corrections and additions apply to the IBM XL C/C++ Enterprise Edition V8.0 for AIX Programming Guide and manual pages.

    Exporting symbols with the CreateExportList utility (C++ only)

    In the syntax diagram, an optional flag -w should appear.

    The following text should be added:

    -w
      Excludes weak symbols from the export list.

    Creating a shared library with the makeC++SharedLib utility (C++ only)

    The following text should be added:

    -w

    Excludes weak symbols from being exported.

    Parallelizing your programs, Shared and private variables in a parallel environment

    The following text:

    The compiler can privatize some shared variables if it is possible to do so without changing the semantics of the program. For example, if each loop iteration uses a unique value of a shared variable, that variable can be privatized. Privatized shared variables are reported by the -qinfo=private option. Use critical sections to synchronize access to all shared variables not listed in this report.

    Should read:

    The compiler can privatize some shared variables if it is possible to do so without changing the semantics of the program. For example, if each loop iteration uses a unique value of a shared variable, that variable can be privatized. Privatized shared variables are reported by the -qreport option. Use critical sections to synchronize access to all shared variables not listed in this report.

    For information on how to list which shared variables are privatized by the compiler, see:
    How to list privatized shared variables in an automatic parallel loop

    Compiler Reference
    The following corrections and additions apply to the IBM XL C/C++ Enterprise Edition V8.0 for AIX Compiler Reference:

    qlanglvl

    -qlanglvl=[no]FileScopeConstExternLinkage option
    The following -qlanglvl option is added:

    [no]FileScopeConstExternLinkage
    Controls whether the file scope of constant variables have internal or external linkage when the static or extern keyword is not specified.

    When -qlanglvl=fileScopeConstExternLinkage is in effect, all file scope constant variables are marked as externally visible. Otherwise, all file scope constant variables are marked as static.

    Default: nofileScopeConstExternLinkage

    [{"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Documentation","Platform":[{"code":"PF002","label":"AIX"}],"Version":"8.0","Edition":"Enterprise Edition","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Compiler","Platform":[{"code":"PF002","label":"AIX"}],"Version":"8.0","Edition":"Enterprise","Line of Business":{"code":"LOB57","label":"Power"}}]

    Document Information

    Modified date:
    06 December 2018

    UID

    swg21232439