xlc(1) IBM XL C Enterprise Edition xlc(1) NAME xlc, cc, c89, c99, xlCcore, xlc++core and related commands - invoke the IBM XL C compiler SYNTAX DESCRIPTION xlc and related commands compile C source files. They also process assembler source files and object files. The compiler calls the link editor to produce a single executable or shared library, unless you specify the compiler options that prevent object files from being linked. The input file may have any of the following suffixes: .c = C source file .i = preprocessed C source file .a = archive file .o = object file for ld command .s = assembler source file OPTIONS Options can be flag options or keyword options: Flag options -# Displays language processing commands but does not invoke them; output goes to standard output. -B When used together with -t, constructs alternate compiler/assembler/link editor/preprocessor program names. specifies a direcory path (including the trailing '/') to be combined together with the standard program name specified by -t. -b{dynamic|shared|static} Controls how shared objects are processed by the linkage editor. Where options are: dynamic, shared Causes the linker to process subsequent shared objects in dynamic mode. This is the default. In dynamic mode, shared objects are not statically included in the output file. Instead, the shared objects are listed in the loader section of the output file. static Causes the linker to process subsequent shared objects in static mode. In static mode, shared objects are statically linked in the output file. -bmaxdata= Sets the maximum size of the area shared by the static data (both initialized and uninitialized) and the heap to bytes. The default is -bmaxdata=0. -brtl Enables run-time linking for the output file. DCE thread libraries and heap debug libraries are not compatible with run- time linking. Do not specify the -brtl compiler option if you are invoking the compiler with xlc_r4 or xlC_r4, or if the -qheapdebug compiler option is specified. -C Preserves comments in preprocessed output, if used with -E or -P. With the -E option, comments are written to standard output. With the -P option, comments are written to an output file. -c Instructs the compiler to pass source files to the compiler only. By specifying this option, the object files are compiled but are not sent to the linkage editor. -D[=[]] Defines as in the #define directive. is an optional definition or value assigned to . -D= (no definition) is equivalent to #define . -D (no = and no definition) is equivalent to #define 1. This is the default. -E Instructs the compiler to preprocess the source files, but does not compile. Output goes to stdout. -e Sets the entry name for a shared executable. This option is only used together with -qmkshrobj. -F[][:] Names an alternative configuration file (.cfg) for the compiler. Where suboptions are: config_file Specifies the name of a compiler configuration file. stanza Specifies the name of the command used to invoke the compiler. This directs the compiler to use the entries under in the to set up the compiler environment. You can use -F[] to invoke the compiler using the defaults specified in a different compiler configuration file. You can use -F[:] to invoke the compiler using the specified stanza. You can combine the two to invoke the compiler using a specific stanza in an alternate compiler configuration file. But unlike the implications of the description, you do not need to specify both. It can be any one or both. -f Passes to the link editor the name of a file that contains a list of input files to be processed. -G Tells the link editor to create a shared object enabled for run-time linking. -g Generates information for debugging tools such as the IBM Distributed Debugger. -I Specifies an additional search path for #include filenames that do not specify an absolute path. -L At link time, searches the path directory for library files specified by the -lkey option. The default is to search only the standard directories. -l Searches the file lib.so and then lib.a for dynamic linking, or only lib.a for static linking. -M Generates information to be included in a "make" description file. The -M and -qmakedep options are equivalent. -ma Generates inline calls to the "alloca" function as if "#pragma alloca" directives were in the source file. -O Optimizes code at a choice of levels during compilation. -O2 Same as -O. -O3 Performs some memory and compile-time intensive optimizations in addition to those executed with -O2. The -O3 specific optimizations have the potential to alter the semantics of a user's program. The compiler guards against these optimizations at -O2 and the option -qstrict is provided at -O3 to turn off these aggressive optimizations. -O4 This option is the same as -O3, except that it also: Sets the -qarch and -qtune options to the architecture of the compiling machine. Sets the -qcache option most appropriate to the characteristics of the compiling machine. Sets the -qhot option. Sets the -qipa option. -O5 Equivalent to -O4 -qipa=level=2. -o Names the executable file instead of a.out. When used with the -c option and one source file, names the object file instead of filename.o. If is the name of a directory, files generated by the compiler will be placed into that directory. -P Preprocesses the C or C++ source files named in the compiler invocation and creates an output preprocessed source file, for each input source file with a valid C or C++ filename extension. -p Sets up the object files produced by the compiler for profiling. -pg Sets up the object files produced by the compiler for profiling ,but provides more information than is provided by the -p option. -qphsinfo | -qnophsinfo Reports the time taken in each compilation phase. Phase information is sent to standard output. The output takes the form / for each phase where represents the CPU time used by the compiler and represents the total of the compiler time and the time that the CPU spends handling system calls. The default is -qnophsinfo. -Q In (C++) language applications, this option instructs the compiler to try to inline functions. Inlining is performed if possible but, depending on which optimizations are performed, some functions might not be inlined. In (C) language applications, this option specifies which specific functions the compiler should attempt to inline. (C++) In the C++ language, the following -Q options apply: -Q Compiler inlines all functions that it can. -Q! Compiler does not inline any functions. (C) In the C language, the following -Q options apply: -Q Attempts to inline all appropriate functions with 20 executable source statements or fewer, subject to the setting of any of the suboptions to the -Q option. If -Q is specified last, all functions are inlined. -Q! Does not inline any functions. If -Q! is specified last, no functions are inlined. -Q- Does not inline functions listed by names. Separate each function name in names with a colon (:). All other appropriate functions are inlined. The option implies -Q. -Q+ Attempts to inline the functions listed by names and any other appropriate functions. Each function name in must be separated by a colon (:). The option implies -Q. -Q= Sets a size limit on the functions to be inlined. The number of executable statements must be less than or equal to for the function to be inlined. must be a positive integer. The default value is 20. Specifying a threshold value of 0 causes no functions to be inlined except those functions marked with the __inline, _Inline, or _inline keywords. The default is to treat inline specifications as a hint to the compiler. -r Produces a relocatable object. This permits the output file to be produced even though it contains unresolved symbols. -S Generates an assembler language file (.s) for each source file. The resulting .s files can be assembled to produce object .o files or an executable file (a.out). -s Strips the symbol table, line number information, and relocation information from the output file. -t Applies the prefix from the -B option to the specified program , where can be one or more of the following: a = assembler b = compiler back end c = compiler front end I = inter-procedural analysis tool - compile phase L = inter-procedural analysis tool - link phase l = linkage editor p = compiler preprocessor -U Undefines the identifier name defined by the compiler or by the -Dname option. -V Instructs the compiler to report information on the progress of the compilation, names the programs being invoked within the compiler and the options being specified to each program. Information is displayed in a space-separated list. -v Instructs the compiler to report information on the progress of the compilation and names the programs being invoked within the compiler and the options being specified to each program. Information is displayed in a comma-separated list. -W,,,... Gives the specified options to the compiler program where can be one of the following: a = assembler b = compiler back end c = compiler front end I = inter-procedural analysis tool - compile phase L = inter-procedural analysis tool - link phase l = linkage editor p = compiler preprocessor -w Suppresses warnings and lower-level messages. Specifying this option is equivalent to specifying -qflag=e:e -y Specifies the compile-time rounding of constant floating-point expressions, where can be one of the following: m = round toward minus infinity n = round to the nearest representable number p = round toward positive infinity z = round toward zero. The default is -yn. -Z Specifies a prefix for the library search path. Keyword options Keyword options are specified in one of the following ways: -q