cc(1)                                                                 cc(1)
                 Requires Optional ANSI C Compiler Software
 
 
 
NAME
      cc, c89 - C compiler
 
SYNOPSIS
      cc [options] files
      c89 [options] files
 
DESCRIPTION
      cc is the HP-UX C compiler.  c89 is the HP-UX POSIX-conforming C
      compiler.  Both accept several types of arguments as files:
 
           +  Arguments whose names end with .c are understood to be C
              source files.  Each is compiled and the resulting object file
              is left in a file having the corresponding basename, but
              suffixed with .o instead of .c.  However, if a single C file
              is compiled and linked, all in one step, the .o file is
              deleted.  Also, the .o file may be renamed by using the -o
              option.
 
           +  Similarly, arguments whose names end with .s are understood to
              be assembly source files and are assembled, producing a .o
              file for each .s file.
 
           +  Arguments whose names end with .i are assumed to be the output
              of cpp (see the -P option below).  They are compiled without
              invoking cpp (see cpp(1)).  Each object file is left in a file
              having the corresponding basename, but suffixed .o instead of
              .i.
 
           +  Arguments of the form -lx cause the linker to search the
              library libx.sl or libx.a in an attempt to resolve currently
              unresolved external references.  Because a library is searched
              when its name is encountered, placement of a -l is
              significant.  If a file contains an unresolved external
              reference, the library containing the definition must be
              placed after the file on the command line.  See ld(1) for
              further details.
 
           +  Arguments of the form -l:libx.suffix cause the linker to
              search the library libx.sl or libx.a (depending on suffix) in
              an attempt to resolve currently unresolved external
              references.  It is similar to the -l option except the current
              state of the -Wl,-a option is not important.
 
           +  All other arguments, such as those whose names end with .o or
              .a, are taken to be relocatable object files that are to be
              included in the link operation.
 
      Arguments and options can be passed to the compiler through the CCOPTS
      environment variable as well as on the command line.  The compiler
      reads the value of CCOPTS and divides these options into two sets;
      those options which appear before a vertical bar (|), and those
      options which appear after the vertical bar.  The first set of options
      is placed before any of the command-line parameters to cc; the second
      set of options is placed after the command-line parameters to cc. If
      the vertical bar is not present, all options are placed before the
      command-line parameters.  For example (in sh(1) notation),
 
           CCOPTS="-v | -lmalloc"
           export CCOPTS
           cc -w prog.c
 
      is equivalent to
 
           cc -v -w prog.c -lmalloc
 
      When set, the TMPDIR environment variable specifies a directory to be
      used by the compiler for temporary files, overriding the default
      directory ⁄var⁄tmp.
 
    Options
      NOTE: for more information about any option, see the HP C Online Help.
      To invoke the guide, use the cc +help option, or use your HTML browser
      to open the file ⁄opt⁄cc⁄html⁄$LANG⁄guide⁄index.htm.
 
      The following option is recognized only by cc:
 
      -Amode         Specify the compilation standard to be used by the
                     compiler.  mode can be one of the following letters:
 
                        c    Compile in a mode compatible with HP-UX
                             releases prior to 7.0.  (See The C Programming
                             Language, First Edition by Kernighan and
                             Ritchie).  To access macros and typedefs that
                             are defined by the HP-UX Operating System,
                             define the symbol _HPUX_SOURCE as described in
                             stdsyms(5) or by including <sys⁄stdsyms.h>.  In
                             most programs <sys⁄stdsyms.h> is included
                             indirectly by including other standard system
                             header files.
 
                        a    Compile under ANSI mode (ANSI programming
                             language C standard ISO 9899:1990).  When
                             compiling under ANSI mode, the header files
                             would define only those names (macros and
                             typedefs) specified by the Standard. To access
                             macros and typedefs that are not defined by the
                             ANSI Standard but are provided by the HP-UX
                             Operating System, define the symbol
                             _HPUX_SOURCE; or use the extension option
                             described below.
 
                        e    (Default) Extended ANSI mode.  Same as -Aa
                             -D_HPUX_SOURCE +e.  This would define the names
                             (macros and typedefs) provided by the HP-UX
                             Operating System and, in addition, allow the
                             following extensions: $ characters in
                             identifier names, sized enums, sized bit-
                             fields, and 64-bit integral type long long.
                             Additional extensions may be added to this
                             option in the future.
 
    Options (General Use)
      The following general use options are recognized by both
      cc and c89:
 
      -Bextern:filename
                     Perform the same operation as +Oextern but fetch the
                     symbols from a text file, instead of from the command
                     line. Symbols referenced in the text file must be
                     separated by white space within the file.
 
      -b             Generate shared library as output. Compiler generates
                     position-independent code (PIC). Is not compatible with
                     the +ESrel, -dynamic, -noshared options.
 
      -c             Suppress the link edit phase of the compilation, and
                     force an object (.o) file to be produced for each .c
                     file even if only one program is compiled.  Object
                     files produced from C programs must be linked before
                     being executed.
 
      -C             Prevent the preprocessor from stripping C-style
                     comments (see cpp(1) for details).
 
      -dynamic       Produces dynamically bound executables.  This option is
                     available with option +DA2.0W only.  See -noshared for
                     statically bound executables.  The default behavior is
                     dynamic.
 
      -Dname=def
      -Dname         Define name to the preprocessor, as if by '#define'.
                     See cpp(1) for details.
 
      -E             Run only cpp on the named C or assembly files, and send
                     the result to the standard output.
 
      -eepsym        Set the default entry point address for the output file
                     to be that of the symbol epsym.  (This option only
                     applies to executable files.)
 
      -fast          Expand into a set of compiler options to result in
                     +Onolooptransform, +Olibcalls, +FPD, +Oentryschedule,
                     +Ofastaccess. You may override any of these options by
                     placing a subsequent option after -fast on the command
                     line.
 
      -g             Cause the compiler to generate additional information
                     needed by the symbolic debugger.
 
      -G             Prepare object files for profiling with gprof (see
                     gprof(1)).
 
      -Idir          Change the algorithm used by the preprocessor for
                     finding include files to also search in directory dir.
                     See cpp(1) for details.
 
      -I-            The directory of the including file is no longer used
                     as the starting point to look up files enclosed with
                     "".  They start at the first -I.  Files enclosed with
                     <> are looked up with the paths following -I-.  See
                     cpp(1) for details.
 
      -lx            Refer to the fourth and fifth bullet items at the
                     beginning of the DESCRIPTION section.
 
      -L dir         Change the algorithm used by the linker to search for
                     libx.sl or libx.a.  The -L option causes cc to search
                     in dir before searching in the default locations.  See
                     ld(1) for details.
 
      -n             Cause the output file from the linker to be marked as
                     shareable.  For details and system defaults, see ld(1).
 
      -noshared      Creates statically bound executables.  This option is
                     available with option +DA2.0W only.  See -dynamic for
                     dynamically bound executables.  The default behavior is
                     dynamic.
 
      -N             Cause the output file from the linker to be marked as
                     unshareable.  For details and system defaults, see
                     ld(1).
 
      -ooutfile      Rename the output file.  The default output file from
                     the linker is a.out.  The default output file from the
                     compiler is a file with the same basename as the source
                     file, but suffixed with .o.
 
      -O             Invoke the optimizer with level 2 optimization.
                     Equivalent to +O2.
 
      -p             Arrange for the compiler to produce code that counts
                     the number of times each routine is called.  Also, if
                     link editing takes place, replace the standard startup
                     routine by one that automatically calls monitor() at
                     the start (see monitor(3C)) and arranges to write out a
                     mon.out file at normal termination of execution of the
                     object program.  prof can then be used to generate an
                     execution profile (see prof(1)).
 
      -P             Run only cpp on the named C files and leave the result
                     on corresponding files suffixed .i.  The -P option is
                     also passed along to cpp.
 
      -q             Cause the output file from the linker to be marked as
                     demand loadable.  For details and system defaults, see
                     ld(1).
 
      -Q             Cause the output file from the linker to be marked as
                     not demand loadable.  For details and system defaults,
                     see ld(1).
 
      -r             Retain relocation information in the output file for
                     subsequent re-linking.  The ld command does not report
                     undefined symbols.
 
      -s             Cause the output of the linker to be stripped of symbol
                     table information.  See strip(1) for more details. The
                     use of this option prevents the use of a symbolic
                     debugger on the resulting program.  See ld(1) for more
                     details.
 
      -S             Compile the named C files, and leave the assembly
                     language output on corresponding files suffixed .s.
 
      -tx,name       Substitute subprocess x with name where x is one or
                     more of a set of identifiers indicating the
                     subprocess(es).  This option works in two modes:  1) if
                     x is a single identifier, name represents the full path
                     name of the new subprocess; 2) if x is a set of
                     identifiers, name represents a prefix to which the
                     standard suffixes are concatenated to construct the
                     full path names of the new subprocesses.
 
                     The x can take one or more of the values:
 
                        p    Preprocessor (standard suffix is cpp)
                        c    Compiler (standard suffix is ccom)
                        a    Assembler (standard suffix is as)
                        l    Linker (standard suffix is ld)
                        u    Stand-alone Code Generator (standard suffix is
                             ucomp)
 
      -Uname         Remove any initial definition of name in the
                     preprocessor.  See cpp(1) for details.
 
      -usymbol       Enter symbol as an undefined symbol in ld's symbol
                     table.  The resulting unresolved reference is useful
                     for linking a program solely from object files in a
                     library.  More than one symbol can be specified, but
                     each must be preceded by -u.
 
      -v             Enable verbose mode, which produces a step-by-step
                     description of the compilation process on the standard
                     error.
 
      -V             Cause each invoked subprocess to print its version
                     information to stdout.
 
      -w             Suppress warning messages.
 
      -Wx,arglist    Pass the comma-separated argument[s] in arglist to
                     subprocess x.  The -W option specification allows
                     additional, implementation-specific options to be
                     recognized by the compiler driver.  For example,
 
                          -Wl,-a,archive
 
                     causes the linker to link with archive libraries
                     instead of with shared libraries.  See ld(1) for
                     details.  For some options, a shorthand notation for
                     this mechanism can be used by placing + in front of the
                     option name as in
 
                          +L
 
                     which is equivalent to
 
                          -Wc,-L
 
                     which causes the compiler to produce a source listing.
                     Options that can be abbreviated using + are
                     implementation dependent, and are listed under
                     DEPENDENCIES.
 
                     The x can assume one of the following values:
 
                        d    Driver
                        p    Preprocessor
                        c    Compiler
                        a    Assembler
                        l    Linker
 
      -Wd,-a         When processing files which have been written in
                     assembly language, does not assemble with the prefix
                     file which sets up the space and subspace structure
                     required by the linker.  Files assembled with this
                     option cannot be linked unless they contain the
                     equivalent information.
 
      -y             Generate a Static Analysis database if SoftBench is
                     installed and ⁄opt⁄softbench⁄bin is at the beginning of
                     your path.  For more information on SoftBench Static
                     Analysis, see the C and C++ SoftBench User's Guide.
                     This option is incompatible with optimization.
 
      -Y             Enable support of multi-byte characters inside string
                     literals and comments.  Note that 8-bit parsing is
                     always supported.  See hpnls(5) for more details on
                     International Support.
 
      -z             Do not bind anything to address zero.  This option
                     allows runtime detection of null pointers.  See the
                     note on pointers below.
 
      -Z             Allow dereferencing of null pointers.  See the note on
                     pointers below.  The -z and -Z are linker options. See
                     ld(1) for more details.
 
      +DAarchitecture
                     Generate code for a particular version of the PA-RISC
                     architecture specified.  Also specifies which version
                     of the HP-UX math library to link when you have
                     specified -lm, and defines architecture to the
                     preprocessor, as if by '#define' (one of _PA_RISC1_0,
                     _PA_RISC1_1 and _PA_RISC2_0).  Note Object code
                     generated for PA-RISC 2.0 will not execute on PA-RISC
                     1.1 systems.  To generate code compatible across PA-
                     RISC 1.1 and 2.0 workstations and servers, use the
                     +DAportable option.  For best performance use +DA with
                     the model number or architecture where you plan to
                     execute the program.  See the file
                     ⁄opt⁄langtools⁄lib⁄sched.models for a list of model
                     numbers and their PA-RISC architecture designations.
                     If you do not specify this option, the default object
                     code generated is determined automatically as that of
                     the machine on which you compile.  Examples
                                    +DA1.1
                                    +DA867
                                    +DA2.0
                                    +DA2.0W
                                    +DAportable
 
                     The first two examples generate code for the PA-RISC
                     1.1 architecture. The third example generates 32-bit
                     code for the PA-RISC 2.0 architecture. The fourth
                     example generates 64-bit code for the PA-RISC 2.0
                     architecture.  The fifth example generates code
                     compatible across PA-RISC 1.1 and 2.0 workstations and
                     servers.
 
      +DDdata_model  Generate code using either the ILP32 or LP64 data
                     model.  Defined values for data_model are:
 
                          32   Use the ILP32 data model.  The size of the
                               int, long and pointer data types is 32-bits.
                               This is currently equivalent to +DA1.1.
                          64   Use the LP64 data model.  The size of the int
                               data type is 32-bits, and the size of the
                               long and pointer data types is 64-bits.
                               Defines __LP64__ to the preprocessor, as if
                               by '#define'.  This is currently equivalent
                               to +DA2.0W.
 
                     Note 64-bit object code is generated for PA-RISC 2.0,
                     and will not execute on PA-RISC 1.1 systems.
 
      +DCapptype     Generate portable or embedded system code.  This is
                     valid in PA64 only.
 
                          o +DCemb: Enable the options frequently used
                               to improve performance for embedded system
                               code.
 
                          o +DChpux: Generates portable code.  This
                               is equivalent to +Oextern.
 
      +DOosname      Sets the target operating system release, either to
                     11.0 (the default) or to 11.0EP9806. When the
                     +Olibcalls option is specified with +DO11.0EP9806 , the
                     compiler enables the fusing of math library calls.
                     Review the +DOosname description in cc +help or the HP
                     C⁄HP-UX Reference Manual before using this option.
 
      +DSmodel       Use the instruction scheduler tuned to the model
                     specified.  If this option is not used, the compiler
                     uses the instruction scheduler for the architecture on
                     which the program is compiled.  The architecture is
                     determined by uname() (see uname(2)).  model can be a
                     model number, PA-RISC architecture designation or PA-
                     RISC processor name.  See the file
                     ⁄opt⁄langtools⁄lib⁄sched.models for a list of model
                     numbers and processor names.
 
      +dfname        Specify profile database file name for profile based
                     optimizations.  The default is flow.data if name is not
                     specified.  Data for more than one application can be
                     kept in the same file.  +df requires the specification
                     of +P.  See ld(1), +P, and +pgm for more details.
 
      +dumpextern:filename
                     Perform the same operation as +Oextern but fetch the
                     symbols from a text file, instead of from the command
                     line. This option is different from -Bextern:filename
                     option in that symbols in the textfile are generated
                     automatically by the linker and the same text file is
                     passed back to the compiler. This option is available
                     only in 64-bit mode. See ld(1) for more details.
 
      +e             Enable HP value-added features while compiling in ANSI
                     C mode, -Aa.  This option is ignored with -Ac because
                     these features are already provided.  Features enabled:
 
                          +  Long pointers
                          +  Integral type specifiers can appear in enum
                             declarations.
                          +  The $ character can appear in identifier names.
                          +  Missing parameters on intrinsic calls
 
      +ES[const|no]lit
                     Control which data items are placed in the read-only
                     data section.  The defined values are:
 
                          +ESconstlit
                               All const-qualified objects and literals are
                               stored in the read-only data section.  This
                               is valid when const char * is legal, and for
                               const-qualified variables that do not require
                               load-time initialization. Literals that have
                               been placed in read-only memory cannot be
                               modified at run-time.
 
                          +ESnolit
                               No constants or literals are placed in the
                               read-only data section.  This option disables
                               the default behavior of _ESconstlit .
 
                          +ESlit
                               All string literals and all const-qualified
                               variables that do not require load-time
                               initialization will be placed in the read-
                               only data section.  This may save space in
                               the resulting executable by coalescing
                               identical string literals, and can promote
                               data sharing in a multi-user application.
 
                     The default is +ESconstlit.
 
      +ESfic         Replaces millicode calls with inline fast indirect
                     calls. The +ESfic compiler option affects how function
                     pointers are dereferenced in generated code. The
                     default is to generate low-level millicode calls for
                     function pointer calls.  The +ESfic option generates
                     code that calls function pointers directly, by
                     branching through them.
                     NOTE: The +ESfic option should only be used in an
                     environment where there are no dependencies on shared
                     libraries. The application must be linked with archive
                     libraries. Using this option can improve run-time
                     performance.
 
      +ESplabel      Replaces millicode calls with inline fast indirect
                     calls, affecting how function pointers are dereferenced
                     in generated code. Can improve run-time performance at
                     the expensive of a slight increase in code size for
                     every call. The default is to generate low-level
                     millicode calls for function pointer calls and virtual
                     calls.  Generates code that calls function pointers
                     directly, by inlining the millicode routine.  Should be
                     used in an environment where there are shared
                     libraries. The application must not be linked with only
                     archive libraries (+A).  Contrast this with +ESfic.
                     This is only available with +DA2.0 or +DA2.0W.
 
      +ESsfc         Replace millicode calls with in-line code when
                     performing function pointer comparisons.  Care should
                     be taken when using this option and pointers to shared
                     library routines are being compared.
 
      +f             Inhibit the automatic promotion of float to double when
                     evaluating expressions.  This differs from +r (see
                     below) in that parameters and function return values
                     are promoted.  This option is ignored and a warning is
                     produced if ANSI mode is in effect.
 
      +FPstring      Specifies how the run time behavior for floating-point
                     operations should be initialized at program start-up.
                     The default is that all behaviors are disabled.  See
                     ld(1) for specific values of string.  To dynamically
                     change these settings at run time, refer to fenv(5).
 
      +help          To access the HP C Online Help.
 
      +hugesize=n[M][K]
                     Lowers the threshold for huge data. The C compiler
                     automatically puts a data object whose size exceeds the
                     initial threshold of .25 gigabytes (2^28 bytes) into a
                     huge (.hbss) subspace. The suffix 'M' specifies
                     megabytes and 'K' specifies kilobytes. 'K' is the
                     default.  You only use this option if linking fails
                     because a combination of smaller data objects overflows
                     in a separate subspace. This option is only available
                     in 64-bit mode.
 
      +I             Instrument the application for profile-based
                     optimization.  See ld(1), +P, and +pgm for more
                     details.  The +I option is incompatible with the -G,
                     +P, and -S options.  It is incompatible with the -g
                     option only during compile time.
 
      +ild           Specify incremental linking.
 
                     If the output file does not exist, or if it was created
                     without the +ild option, the linker performs an initial
                     incremental link. The output file produced is suitable
                     for subsequent incremental links. The incremental link
                     option is valid for both executable and shared library
                     links. It is not valid for relocatable links, options
                     (or tools) that strip the output module, and certain
                     optimization options.  Note that for PA64, wdb debugger
                     will support incremental linking only if the binaries
                     are compiled with -g and +objdebug. See ld(1) for more
                     information.
 
      +ildrelink     Perform an initial incremental link, regardless of the
                     output load module.
 
                     In certain situations during incremental linking (for
                     example, internal padding space is exhausted), the
                     incremental linker is forced to perform an initial
                     incremental link. The +ildrelink option allows you to
                     avoid such unexpected initial incremental links by
                     periodically rebuilding the output file. Note that for
                     PA64, wdb debugger will support incremental linking
                     only if the binaries are compiled with -g and
                     +objdebug.
 
      +k             Cause the compiler to generate the proper instruction
                     sequence necessary for accessing shared global data
                     items, when a program uses a large number of global
                     data items.  The linker will issue an error message
                     when this option is needed.
 
      +L             Enable the listing facility and any listing pragmas.  A
                     straight listing prints:
 
                          +  A header on the top of each page
                          +  Line numbers
                          +  The nesting level of each statement
                          +  The postprocessed source file with expanded
                             macros, included files, and no user comments
                             (unless the -C option is used).
 
                     If the -Aa option is used to compile under ANSI C, the
                     listing shows the original source file rather than the
                     postprocessed source file.
 
      +Lp            Print a listing as described above, but show the
                     postprocessed source file even if one of the ANSI
                     compilation levels is selected.  This option is
                     ineffective if the -y option is used.
 
      +m             Cause the identifier maps to be printed.  First, locals
                     by function are listed, then all global identifiers are
                     listed.  All other identifiers are then listed by
                     function at the end of the listing.  For struct and
                     union members, the address column contains B@b, where B
                     is the byte offset and b is the bit offset.  Both B and
                     b are in hexadecimal.  This option is incompatible with
                     +I and +P.
 
      +Mlevel        Cause migration warnings to be emitted.  Defined values
                     for level are:
 
                          0    (Default) ANSI migration warnings.  These
                               warnings alert the programmer to the so-
                               called Quiet Changes between the K&R behavior
                               ( -Ac) and the ANSI behavior ( -Aa).  For
                               details on the Quiet Changes, refer to the
                               Rationale Document which is available with
                               the ANSI Programming Language C Standard ISO
                               9899:1990.
                          1    Platform migration warnings, for features
                               that may be unsupported in future releases.
                          2    Data model migration warnings.  These
                               warnings alert the programmer to code that
                               may work differently in the LP64 data model
                               than in the ILP32 data model.
 
      +o             Cause the code offsets to be printed in hexadecimal;
                     they are grouped by function at the end of the listing.
                     This option is incompatible with +I and +P.
 
      +objdebug      This option when used with any of the -g options will
                     cause the debug information to be left in the object
                     files instead of being placed in the a.out.  This will
                     bypass the pxdb step and the links will be faster.
                     Available only for wdb(1) or gdb(1).  +noobjdebug is
                     the default at compile time.  +noobjdebug can be used
                     at link time to continue to place the debug info into
                     the a.out, even if some objects were compiled with
                     +objdebug.
                     NOTE: Object files or archive libraries must not be
                     removed if this new method of debugging is used.
 
      +Olevel        Invoke optimizations selected by level.  Defined values
                     for level are:
 
                          0    Perform no optimizations.  This is the
                               default.
                          1    Perform optimizations within basic blocks
                               only.
                          2    Perform level 1 and global optimizations.
                               Same as -O.
                          3    Perform level 2 as well as interprocedural
                               global optimizations.
                          4    Perform level 3 as well as doing link time
                               optimizations.  Also sends +Oprocelim and
                               +Ofastaccess to the linker (see ld(1)).
 
      +P             Optimize the application based on profile data found in
                     the database file flow.data, produced by compilation
                     with +I.  See ld(1), +I, +df, and +pgm for more
                     details.  The +P option is incompatible with the +I and
                     -S options.  It is incompatible with the -g option only
                     during compile time.
 
      +pgmname       Specify a profile database lookup name within the
                     database file name.  +pgm requires that either +I or +P
                     be specified.  See also ld(1), +P, +I, and +df for more
                     details.
 
      +r             Inhibits the automatic promotion of float to double
                     when evaluating expressions and passing arguments.
                     This option is ignored and a warning produced if the
                     ANSI mode is in effect (see also +f).
 
      +sb            Causes unqualified bitfields to be signed.  The default
                     for unqualified bitfields is signed in 32-bit mode and
                     unsigned in 64-bit mode.
 
      +unum          Allow pointers to access non-natively aligned data.
                     This option alters the way that the compiler accesses
                     dereferenced data.  Use of this option may reduce the
                     efficiency of generated code.
 
                          1    Assume single byte alignment.  Dereferences
                               are performed with a series of single-byte
                               loads and stores.
 
                          2    Dereferences are performed with a series of
                               two-byte loads and stores.  This is the
                               default.
 
                          4    Dereferences are performed with a series of
                               four-byte loads and stores.
 
      +wn            Specify the level of the warning messages.  The value
                     of n can be one of the following values:
 
                          1    All warnings are issued (except for ANSI
                               migration warnings; see +M).
                          2    Only warnings indicating that code generation
                               might be affected are issued.  Equivalent to
                               the compiler default without any w opts.
                          3    No warnings are issued.  Equivalent to the -w
                               option.
 
      +W arg1[,arg2,...,argn]
                     Selectively suppresses any specified warning messages,
                     where arg1 through argn are valid compiler warning
                     message numbers.
 
      +We arg1[,arg2,...,argn]
                     Selectively interpret any specified warning or future
                     error messages as errors.  arg1 through argn are valid
                     compiler message numbers.
 
      +Ww arg1[,arg2,...,argn]
                     Selectively treats compiler warnings as warning.  arg1
                     through argn are valid compiler message numbers.
 
                     Conflicts between +W, +Ww and +We are resolved based on
                     their severity, +We being the highest and +W lowest.
 
      +y                Generate static analysis information for all global
                        identifiers not used in the original source file.
                        This option only has effect if used in conjunction
                        with the -y option.
 
                        +z,+Z Both of these options cause the compiler to
                        generate position independent code (PIC) for use in
                        building shared libraries.  +Z is the default in
                        64-bit mode.  The -G and -p options are ignored if
                        +z or +Z is used.  Normally, +z should be used to
                        generate PIC; however, when certain limits are
                        exceeded, +Z is required to generate PIC.  The ld
                        linker issues the error indicating when +Z is
                        required.  If both +z and +Z are specified, only the
                        last one encountered applies.
 
      For a more complete discussion regarding PIC and these options, see
      HP-UX Linker and Libraries Online User's Guide and the manual HP
      C⁄HP-UX Programmer's Guide.
 
      Any other options encountered generate a warning to standard error.
 
      Other arguments are assumed to be C-compatible object programs,
      typically produced by an earlier cc run, or perhaps libraries of C-
      compatible routines.  These programs, together with the results of any
      compilations specified, are linked (in the order given) to produce an
      executable program with the name a.out.
 
    Options (Optimizations)
      The following +O options are recognized by HP C to allow the user to
      enable or disable specific optimization techniques.  Note that you can
      also specify -O in the place of +O to achieve the same affect.
 
      +O[no]autopar  When used with +Oparallel, the +Onoautopar option
                     causes the compiler to parallelize only those loops
                     marked by the loop_parallel or prefer_parallel pragmas.
                     The default is +Oautopar if +Oparallel is enabled at
                     optimization levels 3 and 4.
 
      +O[no]dataprefetch
                     Enable [disable] optimizations to generate data
                     prefetch instructions for data structures referenced
                     within innermost loops.
 
      +O[no]dynsel   When specified with +Oparallel, the +Odynsel option
                     (the default) enables workload-based dynamic selection.
                     The default is +Odynsel if +Oparallel is enabled at
                     optimization levels 3 and 4.
 
      +O[no]entrysched
                     Perform [do not perform] instruction scheduling on a
                     subprogram's entry and exit code sequences.  This
                     optimization can occur at optimization levels 1, 2, 3,
                     and 4.  The default is +Onoentrysched.
 
      +O[no]extern[=name1,name2,...,nameN]
                     If enabled [disabled] without a name list, all symbols
                     are assumed to be external [internal] to the module
                     being compiled. If a name list is specified then only
                     those symbols are in effect.  The optimizer can use
                     this information to generate more efficient code such
                     as optimize references to local symbols.  This option
                     is available in PA64 only.  The default is +Oextern.
 
                          Examples:
 
                          o +Oextern="name1,name2" +Onoextern: name1
                               and name2 are external to the module, all
                               other symbols are internal.
 
                          o +Onoextern="name1,name2": name1 and name2
                               are internal.  All other symbols are external
                               since +Oextern is on by default.
 
 
      +O[no]failsafe Enable [disable] failsafe optimization.  When a
                     compilation fails at the current optimization level
                     +Ofailsafe will automatically restart the compilation
                     at +O0.  The default is +Ofailsafe at optimization
                     levels 1, 2, 3 and 4.
 
      +O[no]fastaccess
                     Enable [disable] fast access to global data.  This
                     optimization can occur at optimization levels 0, 1, 2,
                     3, and 4.  The default is +Onofastaccess at
                     optimization levels 0, 1, 2, and 3; at optimization
                     level 4 the default is +Ofastaccess.
 
      +O[no]fltacc   Disable [enable] optimizations that can result in
                     roundoff.  This option can be used at optimization
                     levels 2, 3, and 4.  The default is +Ofltacc.
 
      +O[no]global_ptrs_unique[=name1,name2,...,nameN]
                     Tell the optimizer whether there are [are not] unique
                     global pointer variable names, and their names.  This
                     option can be used at optimization levels 2, 3, and 4.
                     The default is +Onoglobal_ptrs_unique.
 
      +O[no]info     Provide [do not provide] feedback information about the
                     optimization process.  This option is most useful at
                     optimization levels 3 and 4.  The default is +Onoinfo.
 
      +O[no]initcheck
                     Enable [disable] initialization of any local, scalar,
                     non-static variable that is uninitialized with respect
                     to at least one path leading to its use.  This
                     optimization can occur at optimization levels 2, 3, and
                     4.  The default is to enable initialization if the
                     variable is uninitialized with respect to every path
                     leading to its use.
 
      +O[no]inline[=name1,name2,...,nameN]
                     Request [disable] inlining for the specified
                     procedures.  If specified without a namelist,
                     +O[no]inline requests [disables] inlining for all
                     procedures in the compilation unit.  This option can be
                     used at optimization levels 3 and 4.  The default is
                     +Oinline.
 
      +O[no]inline:filename
                     Perform the same operation as
                     +O[no]inline[=name1,name2,...,nameN] but fetch the
                     symbols from a text file, instead of from the command
                     line. Symbols referenced in the text file must be
                     separated by white space within the file.
 
      +Oinlinebudget=n
                     The +Oinlinebudget option controls the aggressiveness
                     of inlining.  n is an integer in the range 1 - 1000000
                     that specifies the level of aggressiveness as follows:
 
                          n         Meaning
 
                          = 100     Default level on inlining.
                          > 100     More aggressive inlining.
                          2 - 99    Less aggressive inlining.
                          = 1       Only inline if it reduces code size.
 
                     This optimization can occur at optimization levels 3,
                     and 4.  The default is +Oinlinebudget=100.
 
      +O[no]libcalls Use [do not use] low-call-overhead versions of select
                     library routines.  This option can be used at
                     optimization levels 2, 3, and 4.  The default is
                     +Onolibcalls.
 
      +O[no]loop_block
                     Enable [disable] blocking of loops for improved cache
                     performance.  The default is +Onoloop_block at
                     optimization levels 3 and 4.
 
      +O[no]loop_transform
                     Transform [do not transform] eligible loops for
                     improved cache performance.  This option can be used at
                     optimization levels 3 and 4.  The default is
                     +Oloop_transform.
 
      +O[no]loop_unroll[=unroll_factor]
                     Enable [disable] loop unrolling. This optimization can
                     occur at optimization levels 2, 3, and 4.  The default
                     is +Oloop_unroll.  The default unroll_factor is 4, that
                     is, four copies of the loop body.  The unroll_factor
                     controls code expansion.
 
      +O[no]loop_unroll_jam
                     Enable [disable] loop unrolling and jamming which
                     increases register exploitation.  The default is
                     +Onoloop_unroll_jam at optimization levels 3 and 4
 
      +O[no]moveflops
                     Enable [disable] moving conditional floating point
                     instructions out of loops.  This option can be used at
                     optimization levels 2, 3, and 4.  The default is
                     +Omoveflops.
 
      +pa            Requests that the application be compiled for routine-
                     level profiling with CXperf.
 
      +pal           When the optimization options -O (+O2) or +O3 are
                     specified, requests that the application be compiled
                     for routine-level and loop-level profiling with CXperf.
 
      +O[no]parmsoverlap
                     Optimize with the assumption that subprogram arguments
                     may [do not] refer to the same memory.  This option can
                     be used at optimization levels 2, 3, and 4.  The
                     default is +Oparmsoverlap.
 
      +O[no]pipeline Enable [disable] software-pipelining.  This
                     optimization can occur at optimization levels 2, 3, and
                     4.  The default is +Opipeline.
 
      +O[no]procelim Remove [do not remove] any unreferenced procedures from
                     the output executable file.
 
      +O[no]promote_indirect_calls
                     Enable [disable] the promotion of indirect calls to
                     direct calls.  (Indirect calls occur with pointers to
                     functions.) This option can be used at optimization
                     levels 3 and 4. By default, this option is enabled at
                     optimization level 4 if profile-based optimization is
                     being done.  In all other cases, the default is
                     +Onopromote_indirect_calls.
 
      +O[no]ptrs_ansi
                     Supports [does not support] ANSI type pointer aliasing
                     i.e pointers to char may be aliased to a pointer to any
                     object. [Ref. ANSI Standards Sec 6.3]. This
                     optimization can occur at levels 2, 3, 4.  The default
                     is +Onoptrs_ansi.
 
      +O[no]ptrs_to_globals[=name1,name2,...,nameN]
                     Tell the optimizer whether global variables are
                     modified [are not modified] through pointers. This
                     optimization can occur at levels 2, 3, 4.  The default
                     is +Optrs_to_globals.
 
      +O[no]ptrs_strongly_typed
                     Use +Optrs_strongly_typed when pointers are type-safe.
                     The optimizer can use this information to generate more
                     efficient code.  This optimization can occur at levels
                     2, 3, 4.  The default is +Onoptrs_strongly_typed.
 
      +O[no]regionsched
                     Apply [do not apply] aggressive scheduling techniques
                     to move instructions across branches.  This
                     optimization can occur at optimization levels 2, 3, and
                     4.  The default is +Onoregionsched.
 
      +O[no]regreassoc
                     Enable [disable] register reassociation.  This
                     optimization can occur at optimization levels 2, 3, and
                     4.  The default is +Oregreassoc.
 
      +O[no]report[=report_type]
                     Causes the compiler to display [not display] various
                     optimization reports. +Oreport=loop produces the Loop
                     Report. +Oreport=private produces the Loop Report and
                     the Privatization Table, which provides information on
                     loop variables that are privatized by the compiler.
                     +Oreport=all produces all reports.  The default is
                     +Onoreport at optimization levels 3 and 4.
 
      +Oreusedir=path
                     The +Oreusedir option specifies that the intermediate
                     object files produced as a result of a +I, +P or +O4
                     link are either saved in the directory tree at path or
                     are reused from a previous link that used the
                     +Oreusedir option.  This can save considerable amount
                     of time on the subsequent links.  The default is to use
                     TMPDIR and remove the temporary objects after each
                     link.
 
      +O[no]sideeffects=name1,name2,...,nameN
                     Optimize with the assumption that the specified
                     subprograms do [do not] modify global variables and are
                     therefore ineligible for inlining.  This optimization
                     can occur at optimization levels 2, 3, and 4.  The
                     default is to assume that all subprograms have side-
                     effects unless the optimizer can determine that there
                     are none.
 
      +O[no]signedpointers
                     Enable [disable] the treating of pointers as signed
                     quantities.  This optimization can occur at
                     optimization levels 0, 1, 2, 3, and 4.  The default is
                     +Onosignedpointers.
 
      +O[no]sharedgra
                     Disable global register allocation for shared memory
                     variables that are visible to multiple threads.  The
                     default is +Osharedgra at optimization levels 2, 3, and
                     4.
 
      +O[no]static_prediction
                     Enable [disable] static branch prediction. This
                     optimization can occur at optimization levels 2, 3, and
                     4.  Allowed as an amplifier to +P.  (Silently ignored
                     when used with +I.) The default is
                     +Onostatic_prediction.
 
      +uc            Makes unqualified char data types unsigned. By default,
                     the C compiler makes all unqualified char data types
                     signed. Use this option to help port applications from
                     other vendor platforms where the default behavior for
                     unqualified char types is unsigned.  Be careful when
                     using this option.  Your application may have problems
                     interfacing with HP-UX system libraries and other
                     libraries that do not use this option.
 
      +O[no]vectorize
                     Enable [disable] the replacement of selected single-
                     precision loops with vector calls.  This optimization
                     can occur at optimization levels 3 and 4.  The default
                     is +Onovectorize.
 
      +O[no]volatile Enable [disable] the treating of all global variables
                     as volatile quantities.  This optimization can occur at
                     optimization levels 1, 2, 3, and 4.  The default is
                     +Onovolatile.
 
      +O[no]whole_program_mode
                     Asserts [does not assert] that files compiled with this
                     option directly reference only those global variables
                     and procedures that are defined in these files. This
                     optimization can occur at optimization level 4.  The
                     default is +Onowhole_program_mode.
 
Pre-packaged Optimization options
      The following "pre-packaged" optimization options allow you to enable
      or disable groups of optimization techniques:
 
      +O[no]aggressive
           Apply [do not apply] aggressive optimizations; that is, new
           optimizations and the optimizations invoked by the following
           option settings:
 
           +Oentrysched
           +Onofltacc
           +Onoinitcheck
           +Olibcalls
           +Oregionsched
           +Osignedpointers
           +Ovectorize
 
           These optimizations can occur at levels 2, 3, and 4.  The default
           is +Onoaggressive.
 
      +O[no]all
           Apply [do not apply] all optimizations enabled by the
           +Oaggressive and +Onolimit options.  This option automatically
           invokes optimization level 4.  The default is +Onoall.
 
      +O[no]conservative
           Make [do not make] conservative assumptions about the program
           when optimizing.  These optimizations can occur at levels 2, 3,
           and 4.  The default is +Onoconservative.
 
      +O[no]limit
           Suppress [do not suppress] optimizations that significantly
           increase compile-time or consume enormous amounts of memory.
           These optimizations can occur at levels 2, 3, and 4.  The default
           is +Olimit.
 
      +O[level]=name1,name2,...,nameN
           Lower or disable optimization for one or more specified
           functions. This optimization can occur at optimization levels 0,
           1, 2, 3 or 4.  The option cannot raise optimization level above
           what was specified in the +O[level] option.
 
      +O[no]size
           Suppress [do not suppress] optimizations that significantly
           increase code size.  These optimizations can occur at levels 2,
           3, and 4.  The default is +Onosize.
 
    Options (Incremental Linking--64-bit Mode ONLY)
      To use incremental linking from the HP C (cc) compiler, specify the
      +ild from your compiler command line.
 
      In the edit-compile-link-debug development cycle, link time is a
      significant component.  incremental linking can reduce the link time
      by taking advantage of the fact that you can reuse most of the
      previous version of the program and that the unchanged object files do
      not need to be processed.  The incremental linker allows you to insert
      object code into an output file (executable or shared library) that
      you created earlier, without relinking the unmodified object files.
      The time required to relink after the initial incremental link depends
      on the number of modules you modify.
 
      At the request of your compiler, the linker performs the following
      different modes of linking:
 
      +    normal link: the default operation mode in which the linker links
           all modules.
 
      +    initial incremental link: the mode entered when you request an
           incremental link, but the output module created by the
           incremental linker does not exist, or it exists but the
           incremental linker is unable to perform an incremental update.
 
      +    incremental link: the mode entered when you request an
           incremental link, an output module created by the incremental
           linker exists, and the incremental linker does not require an
           initial incremental link.
 
      If the output file does not already exist or if it was created without
      the +ild option, the linker performs an initial incremental
      incremental link. The output file produced is suitable for subsequent
      incremental links. The incremental link option is valid for both
      executable and shared library links. The +ild option is not valid for
      relocatable links, options (or tools) that strip the output module,
      and certain optimization options.
 
      The incremental linker support the +ildrelink option to allow you to
      to instruct the incremental linker to ignore the output load module
      and perform an initial incremental relink.  In certain situations (for
      example, when internal padding space is exhausted), the incremental
      linker is forced to perform an initial incremental link. You can avoid
      such unexpected initial incremental links by periodically rebuilding
      the output file with the +ildrelink option.
 
      The ld command supports additional options with +ild.  +ildnowarn
      supresses all incremental-linking related warning messages. ildpad
      percentage controls the amount of padding (percentage) the incremental
      linker allocates.
 
      NOTE: Do not use the +ild option to create final production modules.
      Because it reserves additional padding space, modules created by the
      incremental linker are considerably larger than those created in
      regular links.
 
      See the Online Linker and Libraries User's Guide (ld +help) and ld(1)
      for more information.
 
EXTERNAL INFLUENCES
    Environment Variables
      When the -Y option is invoked, LC_CTYPE determines the interpretation
      of string literals and comments as single and⁄or multi-byte
      characters.
 
      LANG determines the language in which messages are displayed.
 
      If LC_CTYPE is not specified in the environment or is set to the empty
      string, the value of LANG is used as a default for each unspecified or
      empty variable.  If LANG is not specified or is set to the empty
      string, a default of "C" (see lang(5)) is used.  If any
      internationalization variable contains an invalid setting, cc behaves
      as if all internationalization variables are set to "C".  See
      environ(5).
 
      MP_NUMBER_OF_THREADS
           This environment variable specifies the number of processors that
           are to execute programs that have been compiled for parallel
           execution.  If not set, it defaults to the number of processors
           on the executing machine.
 
           The following command lines show the Korn shell syntax and the C
           shell syntax (respectively) to use when setting the variable to 2
           processors:
 
                export MP_NUMBER_OF_THREADS=2
                setenv MP_NUMBER_OF_THREADS 2
 
    International Code Set Support
      Single- and multi-byte character code sets are supported.
 
DIAGNOSTICS
      The diagnostics produced by C itself are intended to be self-
      explanatory.  Occasionally, messages may be produced by the
      preprocessor, assembler or the linker.
 
      If any errors occur before cc is completed, a non-zero value is
      returned.  Otherwise, zero is returned.
 
EXAMPLES
      The following compiles the C file prog.c to create a prog.o file, then
      invokes the ld linker to link prog.o and procedure.o with all the C
      startup routines in ⁄usr⁄ccs⁄lib⁄crt0.o and library routines from the
      C library libc.sl or libc.a.  The resulting executable program is
      placed in file prog:
 
           cc prog.c procedure.o -o prog
 
WARNINGS
      Options not recognized by cc are not passed on to the linker.  The
      option -Wl,arg can be used to pass any such option to the linker.
 
      By default, the return value from a C program is completely random.
      The only two guaranteed ways to return a specific value are to
      explicitly call exit() (see exit(2)) or leave the function main() with
      a return expression; construct.
 
DEPENDENCIES
      The default is to allow null pointer dereferencing, hence using -Z has
      no effect.
 
      The -g option is incompatible with optimization levels greater than 2.
      In this case, the -g is ignored.  +objdebug is incompatible with any
      optimization level.
 
      The -y option is incompatible with optimization.  If both static
      analysis and optimization are specified, only the first option
      encountered takes effect.
 
      The +k option is incompatible with the +z,+Z options.  In this case,
      the +k option is ignored in favor of the +z,+Z options.
 
      The -s option is incompatible with the -g, -G, -p, and -y options.  If
      -s is specified along with any of the above options, the -s option is
      ignored, regardless of the order in which the options were specified.
 
FILES
      file.c                             input file
      file.o                             object file
      a.out                              linked executable output file
      ⁄var⁄tmp⁄ctm*                      temporary files used by the
                                         compiler
      ⁄usr⁄ccs⁄bin⁄as                    assembler (see as(1))
      ⁄usr⁄ccs⁄bin⁄ld                    linker (see ld(1))
      ⁄opt⁄langtools⁄lib⁄crt0.o          run-time startup code
      ⁄opt⁄langtools⁄lib⁄mpcrt0.o        run-time startup code for programs
                                         compiled for parallel execution
      ⁄opt⁄langtools⁄lib⁄icrt0.o         Startoff for Instrumentation via +I
      ⁄opt⁄langtools⁄lib⁄scrt0.o         like icrt0.o except it is for
                                         shared libraries.
      ⁄opt⁄langtools⁄lib⁄gcrt0.o         startup code for use with profiling
                                         via gprof
      ⁄opt⁄langtools⁄lib⁄mpgcrt0.o       startup code for using gprof with
                                         programs compiled for parallel
                                         execution
      ⁄opt⁄langtools⁄lib⁄mcrt0.o         startup code for use with profiling
                                         via prof
 
      ⁄usr⁄lib⁄libc.a                    standard C library (archive
                                         version), see HP-UX Reference
                                         Section (3).
 
      ⁄usr⁄lib⁄libc.sl                   standard C library (shared
                                         version), see HP-UX Reference
                                         Section (3).
 
      ⁄usr⁄lib⁄libp⁄libc.a               C library for profiled programs
                                         (archive version) via -p⁄-G
 
      ⁄usr⁄include                       standard directory for #include
                                         files
 
    ANSI C compiler Files
      ⁄opt⁄ansic⁄bin⁄cc                  C driver
      ⁄opt⁄ansic⁄lbin⁄ccom               C compiler
      ⁄opt⁄ansic⁄lib⁄nls⁄msg⁄$LANG⁄cc.cat
                                         C compiler message catalog
      ⁄opt⁄langtools⁄lbin⁄cpp            preprocessor
      ⁄opt⁄langtools⁄lbin⁄cpp.ansi       preprocessor for ANSI C
      ⁄opt⁄langtools⁄lbin⁄ucomp          Stand-alone code generator
      ⁄opt⁄langtools⁄lib⁄sched.models    processor implementation file
 
SEE ALSO
    Online help:
    Online help:
      The +help option displays online help using a default HTML browser, or
      you can invoke your own HTML browser with the URL
      file:⁄opt⁄cc⁄html⁄$LANG⁄guide⁄index.htm. Alternatively, setting the
      BROWSER environment variable will override the default HTML browser.
 
      Information is also available on the web at: http:⁄⁄www.hp.com⁄go⁄c
 
    Program management and analysis tools:
      lint(1)        C program checker⁄verifier
      cb(1)          C program beautifier, formatter
      cxref(1)       generate C program cross-reference
 
    Profiling and debugging tools:
      cxperf(1)      C, C++, Fortran parallel application profiler (HP-UX
                     11.x only)
 
      gprof(1)       display call graph profile data
      monitor(3C)    prepare execution profile
      wdb(1)         C and C++ symbolic debugger
      gdb(1)         C and C++ symbolic debugger
      dde(1)         C, C++, Fortran, and Pascal symbolic debugger
      adb(1)         absolute debugger
 
    System tools:
      as(1)          translate assembly code to machine code
      cpp(1)         invoke the the C language preprocessor
      ld(1)          invoke the linker
      cc_bundled(1)  the bundled (limited functionality) C compiler on HP-
                     UX.
 
    Miscellaneous:
      fenv(5)        floating-point environment macros and functions
 
      strip(1)       strip symbol and line number information from an object
                     file
 
      crt0(3)        execution startup routine
 
      end(3C)        symbol of the last locations in program
 
      exit(2)        termination of a process
 
    Tutorials and Standards Documents:
      B. W. Kernighan and D. M. Ritchie, The C Programming Language,
      Prentice-Hall, 1978.
 
      American National Standard for Information Systems - Programming
      language C, ANS X3.159-1989
 
STANDARDS CONFORMANCE
      cc: SVID2, SVID3, XPG2, XPG3, XPG4
 
      c89: POSIX.2
Previous  |  Next ]     [ Up  |  First  |  Last ]     (Article 228 of 485)
 
Comments, flames, broken links?
Please send email to maintainer@intricate-simplicity.com