c89 | cc | c++ | cxx [–+CcEFfgOpqrsVv0123]
[-D name[=value]]… [-U name]…
[-e function] [-u function]…
[-W phase,option[,option]…]…
[-o outfile]
[-I directory]… [-L directory]…
[file.C]… [file.i]… [file.c]… [file.s]…
[file.o]… [file.x]… [file.p]… [file.I]… [file.a]… [-l libname]…
The c89, cc, and c++ commands call other programs for each step of the compilation, assemble and link-editing phases. The list below contains the step name and the name of the document that describes the program you use for that step and the document that describes any messages issued by that program, and prefixes to those messages.
Step Name | Document Describing Options and How to Call Program | Document Containing Messages Issued by Program | Prefix of Messages Issued by Program |
---|---|---|---|
ASSEMBLE | HLASM Programmer's Guide | HLASM Programmer's Guide | ASMA |
COMPILE, IPACOMP, TEMPINC, IPATEMP, IPALINK | z/OS C/C++ User's Guide for releases prior to z/OS V1R7 and z/OS XL C/C++ User's Guide for z/OS V1R7 and later releases | z/OS C/C++ Messages for z/OS V1R5 and z/OS V1R6 releases and z/OS XL C/C++ Messages for z/OS V1R7 and later releases | CCN for z/OS V1R2 and later releases |
PRELINK | z/OS Language Environment Programming Guide and z/OS XL C/C++ User's Guide | z/OS Language Environment Debugging Guide | EDC |
LINKEDIT (Program Management Binder) | z/OS MVS Program Management: User's Guide and Reference | z/OS MVS System Messages, Vol 8 (IEF-IGD) | IEW |
Execution of any Language Environment® program can result in runtime messages. These messages are described in z/OS Language Environment Runtime Messages and have an EDC prefix.
First, the c89, cc, and c++ commands perform the compilation phase (including preprocessing) by compiling all source file operands (file.C, file.i, and file.c, as appropriate). For the c++ command, if automatic template generation is being used (which is the default), then z/OS XL C++ source files may be created or updated in the tempinc subdirectory of the working directory during the compilation phase (the tempinc subdirectory will be created if it does not already exist). Then, the c89, cc, and c++ commands perform the assemble phase by assembling all operands of the file.s form. The result of each compile step and each assemble step is a file.o file. If all compilations and assemblies are successful, or if only file.o and/or file.a files are specified, the c89, cc, and c++ commands proceed to the link-editing phase. For the c++ command, the link-editing phase begins with an automatic template generation step when applicable. For IPA (Interprocedural Analysis) optimization an additional IPA Link step comes next. The link-edit step is last. See the environment variable prefix_STEPS under Environment variables for more information about the link-editing phase steps.
In the link-editing phase, the c89, cc, and c++ commands combine all file.o files from the compilation phase along with any file.o files that were specified on the command line. For the c++ command, this is preceded by compiling all C++ source files in the tempinc subdirectory of the working directory (possibly creating and updating additional C++ source files during the automatic template generation step). After compiling all the C++ source files, the resulting object files are combined along with the file.o files from the compilation phase and the command line. Any file.a files, file.x files and -l libname operands that were specified are also used.
The usual output of the link-editing phase is an executable file. For the c89, cc, and c++ commands to produce an executable file, you must specify at least one operand which is of other than -l libname form. If -r is used, the output file is not executable.
For more information about automatic template generation, see the information on "Using TEMPINC or NOTEMPINC" in z/OS XL C/C++ Programming Guide. Note that the c++ command only supports using the tempinc subdirectory of the working directory for automatic template generation.
For more information on IPA, see Options.
This option effectively overrides the environment variable prefix_EXTRA_ARGS. This option is only supported by the c++ command.
Specify a null S-name ("-e //") so that no function name is identified by the c89/cc/c++ command as the entry point of the program. In that case, the Program Management Binder (link editor) default rules will determine the entry point of the program. For more information about the Program Management Binder and the ENTRY control statement, see z/OS MVS Program Management: User's Guide and Reference.
The function //ceestart is the default. When the default function entry point is used, a binder ORDER control statement is generated by the c89/cc/c++ command to cause the CEESTART code section to be ordered to the beginning of the program. Specify the name with a trailing blank to disable this behavior, as in "//ceestart ". For more information about the Program Management Binder and the ORDER control statement, see z/OS MVS Program Management: User's Guide and Reference.
This option may be required when building products which are intended to be installed using the IBM® SMP/E product. When installing ++MOD elements with SMP/E, binder control statements should be provided in the JCLIN created to install the product instead of being embedded in the elements themselves.
Historical implementations of C/C++ used this option to enable floating-point support. Floating-point is automatically included in z/OS XL C/C++. However, in z/OS XL C/C++, two types of floating-point support are available:
If you are porting an application from another platform, transmitting floating-point numbers between other platforms or workstations, or your application requires the larger exponent range provided by IEEE-754 binary format, then you should consider using IEEE floating-point.
c89 -o outfile -Wc,'float(ieee)' file.c
For 32-bit compiles, if the _DEBUG_FORMAT=ISD environment variable is exported, then -g specifies that the output file (executable) is to contain symbolic information and is to be loaded into read/write storage, which is required for source-level debugging with dbx, and other debuggers.
When specified for the compilation phase, the compiler produces symbolic information for source-level debugging.
When specified for the link-editing phase, the executable file is marked as being serially reusable and will always be loaded into read/write storage.
dbx requires that all the executables comprising the process be loaded into read/write storage so that it can set break points in these executables. When dbx is attached to a running process, this cannot be guaranteed because the process was already running and some executables were already loaded. There are two techniques that will cause all the executables comprising the process to be loaded into read-write storage:
In these cases, use the following technique instead:
If you compile an MVS™ data set source using the -g option, you can use dbx to perform source-level debugging for the executable file. You must first issue the dbx use subcommand to specify a path of double slash (//), causing dbx to recognize that the symbolic name of the primary source file is an MVS data set. For information on the dbx command and its use subcommand, see z/OS UNIX System Services Command Reference.
For more information on using dbx, see z/OS UNIX System Services Programming Tools.
The z/OS UNIX System Services web page also has more information about dbx. Go to http://www.ibm.com/systems/z/os/zos/features/unix/.
For more information on the _BPX_PTRACE_ATTACH environment variable, see z/OS UNIX System Services Programming: Assembler Callable Services Reference.
The GONUMBER option is automatically turned on by the -g option, but can also be turned on independently. There is no execution path overhead incurred for turning on this option, only some additional space for the saved line number tables.
For 31-bit compiles and In Storage Debug (ISD) information, the GONUMBER option generates tables that correspond to the input source file line numbers. These tables make it possible for Debug Tools and for error trace back information in CEE dumps to display the source line numbers. Having source line numbers in CEE dumps improves serviceability costs of applications in production.
c89 -o outfile -Wc,'GONUM' file.c
Absolute pathnames specified on #include directives are searched exactly as specified. The directories specified using the -I option or from the usual places are not searched.
If absolute pathnames are not specified on #include directives, then the search order is as follows:
You can specify an MVS data set name as an include file search directory. Also, MVS data set names can explicitly be specified on #include directives. You can indicate both by specifying a leading double slash (//).
#include <//'abc.hdrs(def)'>
MVS
data set include files are handled according to z/OS XL C/C++ compiler conversion rules (See
Usage Note 4). When specifying
an #include directive with a leading double slash
(in a format other than #include<//'dsname'>
and #include<//dd:ddname>),
the specified name is paired only with MVS data
set names specified on the -I option. That is, when you explicitly
specify an MVS data set name,
any z/OS UNIX file system directory names specified
on the -I option are ignored.For information on specifying C370LIB libraries, see the description of the -l libname operand. Also see Usage Note 7 for a description of the usual places.
When optimization is specified, the default is ANSIALIAS. The ANSIALIAS default specifies whether type-based aliasing is to be used during optimization. That is, the optimizer assumes that pointers can only be used to access objects of the same type. Type-based aliasing improves optimization. Applications that use pointers that point to objects of a different type will need to specify NOANSIALIAS when the optimization compiler option is specified. If your application works when compiled with no optimization and fails when compiled with optimization, then try compiling your application with both optimization and NOANSIALIAS compiler options.
c89 -o outfile -O3 -Wc,NOANSIALIAS file.c
When
optimization is specified, you may want to obtain a report on the
amount of inlining performed and increase or decrease the level of
inlining. More inlining will improve application performance and increase
application memory usage. c89 -o outfile -O2 -Wc,'inline(auto,noreport,500,2500)' file.c
When using IPA, the default is -O (level 1) optimization and inlining. IPA optimization is independent from and can be specified in addition to this optimization level. IPA is further described in this topic.
If compiling with PDF, the same optimization level must be used in the PDF1 and PDF2 steps.
If you compile your program to take advantage of dbx source-level debugging and specify -g (see the -g option description in this topic), you will always get -0 (level zero) optimization regardless of which of these compiler optimization levels you specify.
In addition to using optimization techniques, you may want to control writable strings by using the #pragma strings(readonly) directive or the ROSTRING compiler option. As of z/OS Version 1 Release 2, ROSTRING is the default.
For more information on this topic, refer to reentrancy in z/OS XL C/C++ in z/OS XL C/C++ Programming Guide or the description of ROSTRING | NOROSTRING.
If the -o option is specified in addition to the –c option, and only one source file is specified, then this option specifies the name of the output file associated with the one source file. See file.o under Operands for information on the default name of the output file.
Otherwise the -o option specifies the name of the executable file produced during the link-editing phase. The default output file is a.out.
IPA usage note: When using -r and link-editing IPA compiled object files, you must link-edit with IPA (see the description of IPA under the -W option). However, the -r option is typically not useful when you create an IPA optimized program. This is because link-editing with IPA requires that all of the program information is available to the link editor. It is not acceptable to have unresolved symbols, especially the program entry point symbol, which is usually main. The -r option is normally used when you want to combine object files incrementally. Specify object files during the initial link-edit that uses -r. Later, specify the output of the initial link-edit, along with the remaining object files in a final link-edit that is done without using -r. When you want to combine IPA compiled object files, use the alternative that does not involve the link editor, that is, concatenating the object files into one larger file by using the cp or cat utilities. You can use this larger file later in a final link-edit when the remainder of the object files are also made available.
Specifies that the output file produced by the compiler is in assembler source code format. The absence of the -S flag indicates that the output file produced is in object code format. The -S flag is supported only with the METAL compiler option. The compiler does not produce an object file when the -S flag is used.
By default, the assembler source file name is based on the C source file name specified on the command line. The suffix is determined based on the appropriate environment variable. However, the assembler source file name can be affected by the use of the -o option.
When you specify the -o option, the assembler source file name is based on the name specified with the option. For example, when you specify c89 -S -Wc,metal -c -o foo.x hello.c, the output assembler source file name is foo.x.
The following specifications have the same result:c89 -S -Wc,metal hello.c
c89 -S -Wc,metal -o hello.s hello.c
c89 -S -Wc,metal -c hello.c
c89 -S -Wc,metal -c -o hello.s hello.c
FSUM0000I Utility(c89) Level(UQ99999)
Unlike other phase codes, the IPA phase code I does not require that any additional options be specified, but it does allow them. In order to pass IPA suboptions, specify those suboptions using the IPA phase code.
c89 -c -W I,list file.c
Example: To
specify that an IPA Link-edit should write the map file to stdout,
specify: c89 -W I,map file.o
c89 –W l,p,map file.c
c89 –W l,I,"spill(256)" file.o
c89 –o outdll –W l,dll file.o
In order to create a DLL, some symbols must be identified as being exported for use by other parts of the program. This can be done with the z/OS XL C/C++ #pragma export compiler directive, or by using the z/OS XL C/C++ EXPORTALL compiler option. If during the link-editing phase some of the parts have exported symbols, the executable which is created is a DLL. In addition to the DLL, a definition side-deck is created, containing link-editing phase IMPORT control statements which name those symbols which were exported by the DLL. In order for the definition side-deck to be created, the DLL link editor option must be specified. This definition side-deck is subsequently used during the link-editing phase of a program which is to use the DLL. See the file.x operand description in the Operands topic for information on where the definition side-deck is written. In order for the program to refer to symbols exported by the DLL, it must be compiled with the DLL compiler option.
c89 -o outdll -W c,exportall -W l,dll file.c
To subsequently use file.x definition side-decks, specify them along with any other file.o object files specified for the c89/cc/c++ link-editing phase.
c89 –o myappl –W c,dll myappl.c outdll.x
In order to run an application which is link-edited with a definition side-deck, the DLL must be made available (the definition side-deck created along with the DLL is not needed at execution time). When the DLL resides in the z/OS UNIX file system, it must be in either the working directory or in a directory named on the LIBPATH environment variable. Otherwise it must be a member of a data set in the search order used for MVS programs.
c++ -o outfile -W l,dll=no file.C
When phase code I (capital letter I) is specified for the compilation phase, then IPA compilation steps are performed. When phase code I is specified for the link-editing phase, or when the first link-editing phase (code l) option is i or I, then an additional IPA Link step is performed prior to the prelink and link-edit steps.
With conventional compilation and link-editing, the object code generation takes place during the compilation phase. With IPA compilation and link-editing, the object code generation takes place during the link-editing phase. Therefore, you might need to request listing information about the program (such as with the -V option) during the link-editing phase.
Unlike the other phase codes, phase code I does not require that any additional options be specified. If they are, they should be specified for both the compilation and link-editing phases.
No additional preparation needs to be done in order to use IPA.
c89 –W I –o myIPApgm mypgm.c
When IPA is used with the c++ command, and automatic template generation is being used, phase code I will control whether the automatic template generation compiles are done using IPA. If you do not specify phase code I, then regular compiles will be done. Specifying I as the first option of the link-editing phase option (that is, -W l,I), will cause the IPA linker to be used, but will not cause the IPA compiler to be used for automatic template generation unless phase code I (that is, -W I) is also specified.
The IPA Profile-Directed Feedback (PDF) option tunes optimizations, where results from sample program execution are used to improve optimization near conditional branches and in frequently executed code sections. The profiling information is placed in the file specified by the PDFNAME(filename) suboption. If PDFNAME(filename) is not specified, the default name of the file containing profile information is PDF.
To compile 64-bit code, specify the z/OS XL C/C++ LP64 compiler option.
c89 -o -W c,LP64 -Wl,LP64 file.c
An XPLINK-compiled program is implicitly a DLL-compiled program (the C/C++ DLL compiler option need not be specified along with the XPLINK option). XPLINK improves performance when crossing function boundaries, even across compilation units, since XPLINK uses a more efficient linkage mechanism.
For more information about Extra Performance Linkage, refer to z/OS Language Environment Programming Guide.
To use XPLINK, you must both compile and link-edit the program for XPLINK. All C and C++ source files must be compiled XPLINK, as you cannot statically link together XPLINK and non-XPLINK C and C++ object files (with the exception of non-XPLINK "OS" linkage). You can however mix XPLINK and non-XPLINK executables across DLL and fetch() boundaries.
To compile a program as XPLINK, specify the z/OS XL C/C++ XPLINK compiler option. If there are any exported symbols in the executable and you want to produce a definition side-deck, specify the DLL link editor option. When XPLINK is specified in the link-editing step, different link-edit libraries will be used.
c89 -o outxpl -W c,XPLINK -W l,XPLINK,dll file.c
In
order to execute an XPLINK program, the SCEERUN2 as well as the SCEERUN
data set must be in the MVS program
search order (see the prefix_PLIB_PREFIX environment variable).The c89/cc/c++ command generally recognizes their file operand types by file suffixes. The suffixes shown here represent the default values used by the c89/cc/c++ command. See Environment variables for information about changing the suffixes to be used.
When an IPA linker output file is produced by the c89/cc/c++ command, the default name is based upon the output file name. See the -o option description in the Options topic, for information on the name of the output file.
If the output file is named a.out, then the IPA linker output file is named a.I, and is always in the working directory. If the output file is named //a.load, then the IPA linker output file is named //a.IPA. If the output file specified already has a suffix, that suffix is replaced. Otherwise the suffix is appended. This file may also be specified on the command line, in which case it is used as a file to be link-edited.
When using the c++ command, this source file is recognized as a C++ source file, otherwise it is recognized as a C source file. The c++ command can be made to distinguish between the two. For more information see the environment variables prefix_IXXSUFFIX and prefix_IXXSUFFIX_HOST.
When an object file is produced by the c89/cc/c++ command, the default name is based upon the source file. If the source file is named file.c, then the object file is named file.o, and is always in the working directory. If the source file were a data set named //file.C, then the object file is named //file.OBJ.
If the data set specified as an object file has undefined (U) record format, then it is assumed to be a load module. Load modules are not processed by the prelinker.
You can specify an MVS data set name to be link-edited, by preceding the file name with double slash (//), in which case the last qualifier of the data set name must be OBJ.
c89 //file.OBJ(mem1,mem2,mem3)
When a composite object file is produced by the c89/cc/c++ command, the default name is based upon the output file name. See the -o option description in the Options topic, for information on the name of the output file.
If the output file is named a.out, then the composite object file is named a.p, and is always in the working directory. If the output file is named //a.load, then the composite object file is named //a.CPOBJ. If the output file specified already has a suffix, that suffix is replaced. Otherwise the suffix is appended. This file may also be specified on the command line, in which case it is used as a file to be link-edited.
When a definition side-deck is produced by the c89/cc/c++ command, the default name is based upon the output file name. See the -o option description in the Options topic, for information on the name of the output file.
If the output file is named a.dll, then the definition side-deck is named a.x, and is always in the working directory. If the output file is named //a.DLL, then the definition side-deck is named //a.EXP. If the output file specified already has a suffix, that suffix is replaced. Otherwise the suffix is appended.
You can specify an MVS data set name to be link-edited, by preceding the file name with double slash (//), in which case the last qualifier of the data set name must be EXP.
c89 //file.EXP(mem1,mem2,mem3)
You can also specify an MVS data set; you must specify the full data set name, because there are no rules for searching library directories.
The data set specified must be a C370LIB object library or a load library. If a data set specified as a library has undefined (U) record format, then it is assumed to be a load library. For more information about how load libraries are searched, see Usage Note 7.
You can use environment variables to specify necessary system and operational information to the c89/cc/c++ command. When a particular environment variable is not set, the c89/cc/c++ command uses the default shown. For information about the JCL parameters used in these environment variables, see z/OS MVS JCL User's Guide.
When _CCN_IPA_WORK_SPACE is not specified, the default is to use the settings from prefix_WORK_SPACE. In this case, prefix_WORK_SPACE must be set large enough for the potentially large work files that can be generated by IPALINK. If _CCN_IPA_WORK_SPACE is used, prefix_WORK_SPACE can be tuned for the typically smaller work files generated by the rest of the compiler.
When used under the c89/cc/c++ command, the prelinker by default returns at least a 4 when there are duplicate symbols or unresolved writable static symbols (but not for other unresolved references). The link editor returns at least a 4 when there are duplicate symbols, and at least an 8 when there are unresolved references and automatic library call was used.
To be used, the following data sets must be cataloged:
The following data sets are also used:
The data sets ${prefix_CLASSLIB_PREFIX}.SCLBDLL and ${prefix_CLASSLIB_PREFIX}.SCLBDLL2 contain the z/OS XL C++ Class Library DLLs and messages.
The preceding data sets contain MVS programs that are invoked during the execution of a C++ application built by the c++ command. To be executed correctly, these data sets must be made part of the MVS search order. Regardless of the setting of this or any other c++ environment variable, the c++ command does not affect the MVS search order. These data sets are listed here for information only, to assist in identifying the correct data sets to be added to the MVS program search order.
The default value is the value of the environment variable: _CXX_CLIB_PREFIX
The prefix_CLASSLIB_PREFIX environment variable applies only to the c++ and cxx command names. _CXX is the only valid prefix.The format of this variable is the same as the result of the Language Environment C/C++ runtime library function _librel(). See z/OS XL C/C++ Runtime Library Reference for a description of the _librel() function. The default value is the same as the value for the _CVERSION environment variable. If _CVERSION is not set, then the default value will be the result of the C/C++ runtime library _librel() function.
The prefix_CLASSVERSION environment variable applies only to the c++ and cxx command names. _CXX is the only valid prefix.
The data set ${prefix_CLIB_PREFIX}.SCCNCMP contains the compiler programs called by the c89/cc/c++ command.
The preceding data set contains MVS programs that are invoked during the execution of the c89/cc/c++ command and during the execution of a C/C++ application built by the c89/cc/c++ command. To be executed correctly, the data set must be made part of the MVS search order. Regardless of the setting of this or any other c89/cc/c++ environment variable, c89/cc/c++ does not affect the MVS search order. The data set is listed here for information only, to assist in identifying the correct data set to be added to the MVS program search order.
The following data set is also used:
The data set ${prefix_CLIB_PREFIX}.SCCNOBJ contains object files required to instrument the code for profile-driven feedback optimization.
The default value is CBC.
The default value is 1.
Normally #include directives are resolved using all the information specified including the directory name. When the c89/cc/c++ command can determine that the directory information can be used, such as when the Language Environment include (header) files are installed in the default location (in accordance with prefix_INCDIRS), then the default concatenation is "" (null).
"${prefix_PLIB_PREFIX}.SCEEH.H"
"${prefix_PLIB_PREFIX}.SCEEH.SYS.H"
"${prefix_PLIB_PREFIX}.SCEEH.ARPA.H"
"${prefix_PLIB_PREFIX}.SCEEH.NET.H"
"${prefix_PLIB_PREFIX}.SCEEH.NETINET.H"
When this
variable is a null value, then no allocation is done for compiler
system library data sets. In this case, the use of //DD:SYSLIB on
the -I option and the #include directive will be
unsuccessful. Unless there is a dependency on the use of //DD:SYSLIB,
it is recommended that for improved performance this variable
be allowed to default to a null value.The format of this variable is the same as the result of the Language Environment C/C++ runtime library function _librel(). See z/OS XL C/C++ Runtime Library Reference for a description of the _librel() function. The default value is the result of the C/C++ runtime library _librel() function.
When set to 0, the c89/cc/c++ command treats such a file as an error and the command will be unsuccessful, because the suffix will not be recognized.
When set to 1, the c89/cc/c++ command treats such a file as either an object file or a library, depending on the file itself. If it is neither an object file nor a library then the command will be unsuccessful, because the link-editing phase will be unable to process it. The default value for the c89 and c++ commands is 0. The default value for the cc command is 1.
c89 -WI,control …
The
default value is ipa.ctl.If the c++ command is being used, the default value is //'${prefix_PLIB_PREFIX}.SCEEH.+' //'${prefix_CLIB_PREFIX}.SCLBH.+'
"${prefix_PLIB_PREFIX}.SCEELIB(CELQS003,CELQSCPP,C64)"
"${prefix_CLASSLIB_PREFIX}.SCLBSID(IOSX64)"
"${prefix_PLIB_PREFIX}.SCEEBND2"
"${prefix_SLIB_PREFIX}.CSSLIB"
"${prefix_PLIB_PREFIX}.SCEELKEX"
"${prefix_PLIB_PREFIX}.SCEELKED"
"${prefix_SLIB_PREFIX}.CSSLIB"
"${prefix_PLIB_PREFIX}.SCEEBND2"
"${prefix_SLIB_PREFIX}.CSSLIB"
"${prefix_PLIB_PREFIX}.SCEELIB(CELHS003,CELHS001,CELHSCPP,C128)"
"${prefix_CLASSLIB_PREFIX}.SCLBSID(IOSTREAM,COMPLEX)"
For
32-bit objects, if the c++ command is being
used with prefix_PVERSION and prefix_CLASSVERSION set
to a release prior to z/OS V1R2 for
a 32-bit program, the default value is the list concatenation: "${prefix_PLIB_PREFIX}.SCEELIB(CELHS003,CELHS001,CELHSCPP)"
"${prefix_CLASSLIB_PREFIX}.SCLBSID(ASCCOLL,COMPLEX,IOSTREAM)"
To be used, the following data sets must be cataloged:
These data sets contain MVS programs that are invoked during the execution of the c89/cc/c++ command and during the execution of a C/C++ application built by the c89/cc/c++ command. To be executed correctly, these data sets must be made part of the MVS search order. Regardless of the setting of this or any other c89/cc/c++ environment variable, the c89/cc/c++ command does not affect the MVS program search order. These data sets are listed here for information only, to assist in identifying the correct data sets to be added to the MVS program search order.
The default value is CEE."${prefix_PLIB_PREFIX}.SCEELIB(C128)"
"${prefix_CLASSLIB_PREFIX}.SCLBSID(IOSTREAM,COMPLEX)"
If
the c++ command is being used with prefix_PVERSION
and prefix_CLASSVERSION set to a release prior to z/OS V1R2, the default value is the list ${prefix_CLASSLIB_PREFIX}.SCLBSID(ASCCOLL,COMPLEX,IOSTREAM)"${prefix_PLIB_PREFIX}.SCEEOBJ"
If c++ is
being used, the default value is the list: "${prefix_PLIB_PREFIX}.SCEEOBJ:${prefix_PLIB_PREFIX}.SCEECPP"
The format of this variable is the same as the result of the Language Environment C/C++ runtime library function _librel(). See z/OS XL C/C++ Runtime Library Reference for a description of the _librel() function. The default value is the result of the C/C++ runtime library _librel() function.
"${prefix_PLIB_PREFIX}.SCEEMAC"
"${prefix_SLIB_PREFIX}.MACLIB"
"${prefix_SLIB_PREFIX}.MODGEN"
The format of this variable is a set of binary switches which either enable (when turned on) or disable (when turned off) the corresponding step. Turning a switch on will not cause a step to be enabled if it was not already determined by the c89/cc/c++ command that any other conditions necessary for its use are satisfied. For example, the IPA Link step will not be executed unless the -W option is specified to enable the IPA linker. Enabling the IPA linker is described in Options.
Example: To override the default behavior of the c89/cc/c++ command and cause the prelinker step to be run (this is also the default when the output file is a data set which is not a PDSE), set this variable to: 0xffffffff or the equivalent, -1. The default value when the output file is a z/OS UNIX file or a PDSE data set is 0xfffffffd or the equivalent, -3.
The format of this variable is a set of binary switches which either cause a temporary file to be used (when turned on) or a permanent file to be used (when turned off) in the corresponding step.
The correspondence of these switches to steps is the same as for the variable prefix_STEPS. Only the prelinker and IPA linker output can be captured using this variable.
Example: To capture the prelinker output, set this variable to: 0xfffffffD or the equivalent, -3. The default value is 0xffffffff or the equivalent, -1.
To escape these special characters, either enclose the option-argument or operand in double quotation marks, or precede each character with a backslash.
Such data sets are installed with the Language Environment runtime library. When it is allocated, searching for these include files can be specified on the -I option as //DD:SYSLIB. (See the description of environment variable prefix_CSYSLIB for information.
When include files are MVS PDS members, z/OS XL C/C++ uses conversion rules to transform the include (header) file name on a #include preprocessor directive into a member name. If the "//'dataset_prefix.+'" syntax is not used for the MVS data set which is being searched for the include file, then this transformation strips any directory name on the #include directive, and then takes the first 8 or fewer characters up to the first dot (.).
If the "//'dataset_prefix.+'" syntax is used for the MVS data set which is being searched for the include file, then this transformation uses any directory name on the #include directive, and the characters following the first dot (.), and substitutes the "+" of the data set being searched with these qualifiers.
In both cases the data set name and member name are converted to uppercase and underscores (_) are changed to at signs (@).
If the include (header) files provided by the Language Environment runtime library are installed into the hierarchical file system in the default location (in accordance with the prefix_INCDIRS environment variable), then the compiler will use those files to resolve #include directives during compilation. The c89/cc/c++ command by default searches the directory /usr/include as the usual place, just before searching the data sets just described. See the description of environment variables prefix_CSYSLIB, prefix_INCDIRS, and prefix_INCLIBS for information about customizing the default directories to search.
The c89/cc/c++ command adds these macro definitions only after processing the command string. Therefore, you can override these macros by specifying -D or -U options for them on the command string.
This list of environment variables affects the link-editing phase of the c89 utility, but only for non-XPLINK link-editing. See XPLINK (Extra Performance Linkage) in Options.
c89/cc/c++ environment variables do not affect the MVS program search order. Also, for the c89/cc/c++ command to work correctly, the setting of the STEPLIB environment variable should reflect the Language Environment library in use at the time that c89/cc/c++ is invoked.
However, the Shell and Utilities feature does not support this convention. Do not use this convention (//) unless it is specifically indicated (as here in c89/cc/c++). The z/OS Shell and Utilities feature does support the POSIX file naming convention where the filename can be selected from the set of character values excluding the slash and the null character.
export _C89_NOCMDOPTS=1
c89 -o hello hello.c
export _C89_LSYSLIB="CEE.SCEELKEX:CEE.SCEELKED:CBC.SCCNOBJ:SYS1.CSSLIB"
This
environment variable will produce the following SYSLIB concatenation: //SYSLIB DD DSN=CEE.SCEELKEX,DISP=SHR
// DD DSN=CEE.SCEELKED,DISP=SHR
// DD DSN=CBC.SCCNOBJ,DISP=SHR
// DD DSN=SYS1.CSSLIB,DISP=SHR
For the c89 command, X/Open Portability Guide, POSIX.2 C-Language Development Utilities Option.
For the cc command, POSIX.2 C-Language Development Utilities Option, UNIX systems.
c89 -O2 hello.c
c89 -2 hello.c
c89 -o HelloWorld -2 -Wc,NOANSIALIAS -Wc,XPLINK\
-Wl,XPLINK -Wc,'FLOAT(IEEE)' -Wc,'GONUM' HelloWorld.c
See the information on the following utilities in z/OS UNIX System Services Command Reference: ar, dbx, file, lex, makedepend, nm, strings, strip, and yacc.