z/OS V1R11 XL C/C++ readme This readme file contains the latest information about the "C/C++ without Debug Tool" optional feature of z/OS V1R11 that was not previously available for the documentation. This file will be updated from time to time via PTF, so that you can get the latest information possible. ======================================================================== 1. The following information relates to Chapter 8 of the z/OS V1R11 XL C/C++ User's Guide. In the section "Creating a DLL with IPA -> Example 2. using the IPA control file", the first code block should read as follows: export=get_user_input__7UIclassFv, get_user_sort_method__7UIclassFRi, call_user_sort_method__7UIclassFi, print_sort_result__7UIclassFv In the section "Reference Information -> IPA Link step control file", a directive in the control file reads "exports=name[,name]". It should read "export=name[,name]". ======================================================================== 2. The following information relates to Chapter 1 of the z/OS V1R11 Metal C Programming Guide and Reference in "Function save areas": The last paragraph of the section "Function save areas" reads: "If the function needs to call an AR-mode function, the save area will take the 54-word F7SA format, regardless of the addressing mode, and the compiler will generate code to set up the F7SA signature in the second word of the save area." This paragraph should read as the following two paragraphs: "If the function needs to call an AR-mode function, the save area will take the 54-word F7SA format, regardless of the addressing mode." "The F4SA signature generation can be suppressed by setting the &CCN_SASIG Global Set Symbol to 0 in your prolog code. For information about the &CCN_SASIG Global Set Symbol, see 'Table 3 User modifiable global SET symbols'." ======================================================================== 3. The following information relates to Chapter 1 of the z/OS V1R11 Metal C Programming Guide and Reference in the section "Compiler-generated global SET symbols": The following lines are added to "Table 2. Compiler-generated global SET symbols": Global Set Symbol: &CCN_STATIC Type: Logical Description: Set to "1" if the function is static. Global Set Symbol: &CCN_NAB_OFFSET Type: Character Description: The assembly time computed offset to the NAB pointer on the stack of the function. The following example shows how &CCN_NAB_OFFSET is set by the compiler: &CCN_NAB_OFFSET SETC'#NAB_2-@@AUTO@2' The following example shows how &CCN_NAB_OFFSET can be used in the prolog code: STG 0,&CCN_NAB_OFFSET.(,13) Global Set Symbol: &CCN_IASM_MACRO Type: Character Description: The name of the in-stream macro that contains all the #pragma insert_asm supplied statements. The setting of &CCN_IASM_MACRO only happens in the presence of inserted assembler statements provided by #pragma insert_asm directives. In the presence of such directives, the compiler generates an in-stream HLASM MACRO like this: MACRO @@IASM@ *from #pragma insert_asm #1 000004 *from #pragma insert_asm #2 000006 *from #pragma insert_asm #3 000008 MEND The following example shows how &CCN_IASM_MACRO is set by the compiler: &CCN_IASM_MACRO SETC '@@IASM@' The MACRO name in &CCN_IASM_MACRO can be placed anywhere within the prolog/epilog code. Global Set Symbol: &CCN_PRCN_LONG Type: Character Description: The actual function name up to the 1024 character HLASM limit. The setting of &CCN_PRCN_LONG is subject to the HLASM limit of 1024 characters on a SETC instruction. When the function name is longer than 1024 characters, the character value set will be truncated to 1021 characters and appended with '...'. The following lines are added to "Table 3. User modifiable global SET symbols": Global Set Symbol: &CCN_NAB_STORED Type: Logical Default: 0 Description: Set to "1" to indicate that NAB pointer storing code was done in the prolog code. The following example shows the code that is generated by the compiler to cause the NAB computing and storing code to be conditionally assembled based on the setting of &CCN_NAB_STORED: AIF (&CCN_NAB_STORED).@@NONAB2 LGHI 0,160 ALGR 0,13 STG 0,#NAB_2-@@AUTO@2(,13) .@@NONAB2 ANOP Global Set Symbol: &CCN_IASM_FRONT Type: Logical Default: 0 Description: Set to "1" to indicate that &CCN_IASM_MACRO was already called. The following example shows the code that is generated by the compiler to cause the &CCN_IASM_MACRO to be conditionally assembled based on the setting of &CCN_IASM_STORE: AIF (&CCN_IASM_FRONT).@@NOIASM1 @@IASM@ .@@NOIASM1 ANOP ======================================================================== 4. The following information relates to Chapter 1 of the z/OS V1R11 XL C/C++ Compiler and Run-Time Migration Guide for the Application Programmer. The section "CICS TS V4.1 support enhancements" should read as follows: "As of CICS TS V4.1, CICS TS fully supports MVS Linkage conventions. Therefore, if you are compiling floating point code to be run on CICS TS V4.1, you no longer need to use the FLOAT(AFP(VOLATILE)) option. For detailed information, see CICS TS V4.1 with Extended MVS Linkage Convention on page 122". ======================================================================== 5. The following information relates to Chapter 19 of the z/OS V1R11 XL C/C++ Compiler and Run-Time Migration Guide for the Application Programmer. The section "CICS TS V4.1 with Extended MVS Linkage Convention" should read as the following three paragraphs: "The FLOAT(AFP) compiler option instructs the compiler to generate code that uses the full complement of 16 floating-point registers (FPRs). The four original floating-point registers are numbered FPR0, FPR2, FPR4, and FPR6; the additional floating-point (AFP) registers are numbered FPR 1, FPR 3, FPR 5, FPR 7 and FPRs 8 through 15. By convention, FPRs 1, 3, 5, and 7 are always volatile. This means that any called routine could change their values without saving and restoring the original values. However, FPRs 8 through 15 are considered non-volatile by the caller." "In z/OS V1R9 XL C/C++ compiler (and later compilers), FLOAT(AFP) supports the VOLATILE | NOVOLATILE suboption. The default is NOVOLATILE; the compiler assumes that any called subroutines will preserve the values in registers FPRs 8 through 15. It is safe to use NOVOLATILE in most environments, including batch. However, CICS environments prior to CICS TS V4.1 use FPRs 7 through 15 to perform their own task switching. Therefore you need to specify the FLOAT(AFP(VOLATILE)) option to instruct the compiler to treat FPRs 8 through 15 as volatile." "As of CICS TS V4.1, CICS TS fully supports MVS Linkage conventions, so if you are compiling floating point code to be run on CICS TS V4.1, you no longer need to use the FLOAT(AFP(VOLATILE)) option." ======================================================================== 6. The following information relates to Chapter 1 of the z/OS V1R11 XL C/C++ User's Guide. The section "Performance improvements" should read as follows: "As an ongoing effort, improvements are provided in the generated code to take advantage of new instructions in the hardware architecture. You can benefit from these improvements by recompiling your existing source without code changes." "Compiling with AFP(VOLATILE) for floating point code under CICS is no longer necessary if you are running under CICS- TS V4.1, which has Extended MVS Linkage Convention support. For a summary of whether to recompile the source codes under various situations using AFP(VOLATILE) and CICS, see Table 22 on page 116." ======================================================================== 7. The following information relates to Chapter 4 of the z/OS V1R11 XL C/C++ User's Guide. In the section "AFP(VOLATILE | NOVOLATILE) | NOAFP", the paragraph after the second note should read as follows: "Compiling with AFP(VOLATILE) for floating point code under CICS is no longer necessary with CICS TS V4.1, which has Extended MVS Linkage Convention Support. If you are at CICS TS V4.1, you may be able to realize a performance improvement by recompiling the relevant floating point code with the default FLOAT(AFP(NOVOLATILE)). However, if you have floating point code that runs on an earlier CICS TS release, you should use the AFP(VOLATILE) sub-option on the relevant source files to avoid potential exposure for data corruption or undetected loss of data. For information about the Load Module Analyzer, which can detect programs that need to be compiled with FLOAT(AFP(VOLATILE)), see support document at http://www-01.ibm.com/support/docview.wss?rs=1083&uid=swg24010925. See Table 22 for a summary of the various scenarios." Table 22 should read as follows: Table 22. Various scenarios for FLOAT(AFP) a CICS environment CICS TS Version: 2.3, 3.1, and 3.2 FLOAT(AFP) Suboptions Used: FLOAT(AFP) FLOAT(AFP(NOVOLATILE)) (this is the default value). Result: Potential exposure for data corruption or undetected loss of data. Action: Recompile with FLOAT(AFP(VOLATILE)). CICS TS Version: 2.3, 3.1, and 3.2 FLOAT(AFP) Suboptions Used: FLOAT(AFP(VOLATILE)) Result: Removes potential exposures for data corruption or undetected loss of data, at some cost in Performance. Action: No action required. CICS TS Version: 4.1 FLOAT(AFP) Suboptions Used: FLOAT(AFP) FLOAT(AFP(NOVOLATILE)) (this is the default value). Result: No potential exposures for data corruption or undetected loss of data, optimal performance. Action: No action required. CICS TS Version: 4.1 FLOAT(AFP) Suboptions Used: FLOAT(AFP(VOLATILE)) Result: No potential exposures for data corruption or undetected loss of data, some cost in Performance. Action: No action required, but recompiling with FLOAT(AFP(NOVOLATILE)) is designed to improve performance. ======================================================================== 8. The following information relates to Chapter 51 of the z/OS V1R11 XL C/C++ Programming Guide. In the section "Using the XL C/C++ DB2 coprocessor", the following note is added at the end of the section: "Note: "SQLCODE", "SQLSTATE", and "sqlca" are not valid user host variable names, because they are reserved by the compiler and DB2 coprocessor as embedded SQL keywords. Previous to the compiler embedding the DB2 coprocessor, the DB2 precompiler did not recognize these three identifiers as keywords, but the new DB2 coprocessor correctly recognizes them and will not successfully compile any source file that attempts to use them as user host variable names. If you are already using any of these reserved keywords as table column names in your program (and referencing them through identically named user host variable names), and you are migrating from a compiler release that uses the DB2 precompiler to one that uses the DB2 coprocessor, you must restructure your queries in order to avoid any conflicts with these reserved keywords. For detailed information, see "SQL Queries" in DB2 Version 9.1 for z/OS SQL Reference at http://www.ibm.com/software/data/db2/zos/library.html." ======================================================================== December, 2009 The following information relates to Chapter 3 of the z/OS V1R11 Metal C Programming Guide and Reference: In the "Example" section under the section "__cinit() - Initialize a Metal C environment", the following note is added after the example code: "Note: To compile this example code, you must specify the LONGNAME option, or the LP64 option, or both." ======================================================================== June, 2010 The following information relates to the improved compile time performance by doing less inlining in V1R11 PTF: "The V1R11 compiler introduced a defect in handling the "limit" value specified in the INLINE option. Instead of allowing a function size to be grown "to" that limit from inlining, the V1R11 compiler allowed the function size to be grown "by" that limit therefore causing overly aggressive inlining. As a result, the function body might become very large which causes extra compile time needed for optimization. The V1R11 PTF fixes the inline limit handling defect. Some functions may stop being inlined after you have applied the PTF. If you want more inlining to be performed by the compiler, you can adjust the limit value with the INLINE option. For more information, see INLINE | NOINLINE in the z/OS V1R11.0 XL C/C++ User's Guide." ======================================================================== July 2010 Additional information about the LONGNAME compiler option and prelinking z/OS XL C/C++ programs - The following information is added to the section "Specifying z/OS XL C compiler options using #pragma options" in the z/OS V1R11 XL C/C++ User's Guide. "You can use the #pragma preprocessor directive to override the default values for compiler options. The exception is LONGNAME/NOLONGNAME, where the compiler options override the #pragma preprocessor directives." - The following note is added to the section "Pragma equivalent" under "LONGNAME | NOLONGNAME" in the z/OS V1R11 XL C/C++ User's Guide. "You can use the #pragma preprocessor directive to override the default values for compiler options. However, for LONGNAME/NOLONGNAME, the compiler options override the #pragma preprocessor directives." - The following note is added to the section "Mapping long names to short names" in the z/OS V1R11 XL C/C++ User's Guide. "Programs compiled with the LONGNAME compiler option and which use POSIX functions must define _LONGMAP when using the prelinker outside of a z/OS UNIX shell environment. If __LONGNAME__ is defined and _LONGMAP is not defined, you will not get the right mapping of POSIX functions." ======================================================================== July 2010 Description changes of suboption "ZEROEXTARRAY | NOZEROEXTARRAY" - The description of suboption "ZEROEXTARRAY | NOZEROEXTARRAY" in the z/OS V1R11 XL C/C++ User's Guide is changed to: "This option controls whether zero-extent arrays are allowed as the last non-static data member in a structure definition. When LANG(ZEROEXTARRAY) is in effect, the z/OS XL C++ compiler allows arrays with zero elements. This is an extension to the C++ standard. Example: The following statement declares a zero-extent array a: struct S1 { char a[0]; }; Specify LANG(NOZEROEXTARRAY) for compliance with the ISO C++ standard. When LANG(ZEROEXTARRAY) is set, you will receive informational messages about zero-extent arrays in your code, unless you suppress the message with SUPPRESS(CCN6607). The default is LANG(ZEROEXTARRAY)." ======================================================================== July 2010 Additional information about #pragma prolog and #pragma epilog - The following information is added to the end of the section "Supplying your own prolog and epilog code" in the z/OS V1R11 Metal C Programming Guide and Reference. "Starting from z/OS V1R11, the following pragma directives are also supported: #pragma prolog(function_name, main) #pragma epilog(function_name, main) When the keyword main is specified instead of HLASM Statements, the default prolog/epilog code generated by the compiler for function_name is the same as if it was generated for function main." ======================================================================== August 2010 Description changes of message CCN2320 - The "User response" part of message CCN2320 in the z/OS V1R11 XL C/C++ Messages is changed to: "User response: No user response is required." ========================================================================