C99(1)                     POSIX Programmer's Manual                    C99(1)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.


NNAAMMEE
       c99 -- compile standard C programs

SSYYNNOOPPSSIISS
       c99 [[_o_p_t_i_o_n_s...]] _p_a_t_h_n_a_m_e [[[[_p_a_t_h_n_a_m_e]] [[-I _d_i_r_e_c_t_o_r_y]]
           [[-L _d_i_r_e_c_t_o_r_y]] [[-l _l_i_b_r_a_r_y]]]]...

DDEESSCCRRIIPPTTIIOONN
       The _c_9_9 utility is an interface to the standard C compilation system;
       it shall accept source code conforming to the ISO C standard. The
       system conceptually consists of a compiler and link editor. The input
       files referenced by _p_a_t_h_n_a_m_e operands and --ll option-arguments shall be
       compiled and linked to produce an executable file. (It is unspecified
       whether the linking occurs entirely within the operation of _c_9_9; some
       implementations may produce objects that are not fully resolved until
       the file is executed.)

       If the --cc option is specified, for all pathname operands of the form
       _f_i_l_e..cc, the files:

           $$((bbaasseennaammee _p_a_t_h_n_a_m_e .c).o

       shall be created as the result of successful compilation. If the --cc
       option is not specified, it is unspecified whether such ..oo files are
       created or deleted for the _f_i_l_e..cc operands.

       If there are no options that prevent link editing (such as --cc or --EE),
       and all input files compile and link without error, the resulting
       executable file shall be written according to the --oo _o_u_t_f_i_l_e option (if
       present) or to the file aa..oouutt.

       The executable file shall be created as specified in _S_e_c_t_i_o_n _1_._1_._1_._4,
       _F_i_l_e _R_e_a_d, _W_r_i_t_e, _a_n_d _C_r_e_a_t_i_o_n, except that the file permission bits
       shall be set to: S_IRWXO | S_IRWXG | S_IRWXU

       and the bits specified by the _u_m_a_s_k of the process shall be cleared.

OOPPTTIIOONNSS
       The _c_9_9 utility shall conform to the Base Definitions volume of
       POSIX.1-2008, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s, except that:

        *  Options can be interspersed with operands.

        *  The order of specifying the --LL and --ll options, and the order of
           specifying --ll options with respect to _p_a_t_h_n_a_m_e operands is
           significant.

        *  Conforming applications shall specify each option separately; that
           is, grouping option letters (for example, --ccOO) need not be
           recognized by all implementations.

       The following options shall be supported:

       --cc        Suppress the link-edit phase of the compilation, and do not
                 remove any object files that are produced.

       --DD _n_a_m_e[[==_v_a_l_u_e]]
                 Define _n_a_m_e as if by a C-language ##ddeeffiinnee directive. If no
                 =_v_a_l_u_e is given, a value of 1 shall be used. The --DD option
                 has lower precedence than the --UU option. That is, if _n_a_m_e is
                 used in both a --UU and a --DD option, _n_a_m_e shall be undefined
                 regardless of the order of the options. Additional
                 implementation-defined _n_a_m_es may be provided by the compiler.
                 Implementations shall support at least 2048 bytes of --DD
                 definitions and 256 _n_a_m_e_s.

       --EE        Copy C-language source files to standard output, expanding
                 all preprocessor directives; no compilation shall be
                 performed. If any operand is not a text file, the effects are
                 unspecified.

       --gg        Produce symbolic information in the object or executable
                 files; the nature of this information is unspecified, and may
                 be modified by implementation-defined interactions with other
                 options.

       --II _d_i_r_e_c_t_o_r_y
                 Change the algorithm for searching for headers whose names
                 are not absolute pathnames to look in the directory named by
                 the _d_i_r_e_c_t_o_r_y pathname before looking in the usual places.
                 Thus, headers whose names are enclosed in double-quotes ("""")
                 shall be searched for first in the directory of the file with
                 the ##iinncclluuddee line, then in directories named in --II options,
                 and last in the usual places. For headers whose names are
                 enclosed in angle brackets (""<<>>""), the header shall be
                 searched for only in directories named in --II options and then
                 in the usual places. Directories named in --II options shall be
                 searched in the order specified. If the --II option is used to
                 specify a directory that is one of the usual places searched
                 by default, the results are unspecified. Implementations
                 shall support at least ten instances of this option in a
                 single _c_9_9 command invocation.

       --LL _d_i_r_e_c_t_o_r_y
                 Change the algorithm of searching for the libraries named in
                 the --ll objects to look in the directory named by the
                 _d_i_r_e_c_t_o_r_y pathname before looking in the usual places.
                 Directories named in --LL options shall be searched in the
                 order specified. If the --LL option is used to specify a
                 directory that is one of the usual places searched by
                 default, the results are unspecified. Implementations shall
                 support at least ten instances of this option in a single _c_9_9
                 command invocation. If a directory specified by a --LL option
                 contains files with names starting with any of the strings
                 ""lliibbcc.."", ""lliibbll.."", ""lliibbpptthhrreeaadd.."", ""lliibbmm.."", ""lliibbrrtt.."",
                 ""lliibbttrraaccee.."", ""lliibbxxnneett.."", or ""lliibbyy.."", the results are
                 unspecified.

       --ll _l_i_b_r_a_r_y
                 Search the library named lliibblliibbrraarryy..aa.  A library shall be
                 searched when its name is encountered, so the placement of a
                 --ll option is significant. Several standard libraries can be
                 specified in this manner, as described in the EXTENDED
                 DESCRIPTION section. Implementations may recognize
                 implementation-defined suffixes other than ..aa as denoting
                 libraries.

       --OO _o_p_t_l_e_v_e_l
                 Specify the level of code optimization. If the _o_p_t_l_e_v_e_l
                 option-argument is the digit ''00'', all special code
                 optimizations shall be disabled. If it is the digit ''11'', the
                 nature of the optimization is unspecified. If the --OO option
                 is omitted, the nature of the system's default optimization
                 is unspecified. It is unspecified whether code generated in
                 the presence of the --OO 0 option is the same as that generated
                 when --OO is omitted. Other _o_p_t_l_e_v_e_l values may be supported.

       --oo _o_u_t_f_i_l_e
                 Use the pathname _o_u_t_f_i_l_e, instead of the default aa..oouutt, for
                 the executable file produced. If the --oo option is present
                 with --cc or --EE, the result is unspecified.

       --ss        Produce object or executable files, or both, from which
                 symbolic and other information not required for proper
                 execution using the _e_x_e_c family defined in the System
                 Interfaces volume of POSIX.1-2008 has been removed
                 (stripped). If both --gg and --ss options are present, the action
                 taken is unspecified.

       --UU _n_a_m_e   Remove any initial definition of _n_a_m_e.

       Multiple instances of the --DD, --II, --LL, --ll, and --UU options can be
       specified.

OOPPEERRAANNDDSS
       The application shall ensure that at least one _p_a_t_h_n_a_m_e operand is
       specified. The following forms for _p_a_t_h_n_a_m_e operands shall be
       supported:

       _f_i_l_e_.cc    A C-language source file to be compiled and optionally
                 linked. The application shall ensure that the operand is of
                 this form if the --cc option is used.

       _f_i_l_e_.aa    A library of object files typically produced by the _a_r
                 utility, and passed directly to the link editor.
                 Implementations may recognize implementation-defined suffixes
                 other than ..aa as denoting object file libraries.

       _f_i_l_e_.oo    An object file produced by _c_9_9 --cc and passed directly to the
                 link editor. Implementations may recognize implementation-
                 defined suffixes other than ..oo as denoting object files.

       The processing of other files is implementation-defined.

SSTTDDIINN
       Not used.

IINNPPUUTT FFIILLEESS
       Each input file shall be one of the following: a text file containing a
       C-language source program, an object file in the format produced by _c_9_9
       --cc, or a library of object files, in the format produced by archiving
       zero or more object files, using _a_r.  Implementations may supply
       additional utilities that produce files in these formats. Additional
       input file formats are implementation-defined.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       The following environment variables shall affect the execution of _c_9_9:

       _L_A_N_G      Provide a default value for the internationalization
                 variables that are unset or null. (See the Base Definitions
                 volume of POSIX.1-2008, _S_e_c_t_i_o_n _8_._2, _I_n_t_e_r_n_a_t_i_o_n_a_l_i_z_a_t_i_o_n
                 _V_a_r_i_a_b_l_e_s for the precedence of internationalization
                 variables used to determine the values of locale categories.)

       _L_C___A_L_L    If set to a non-empty string value, override the values of
                 all the other internationalization variables.

       _L_C___C_T_Y_P_E  Determine the locale for the interpretation of sequences of
                 bytes of text data as characters (for example, single-byte as
                 opposed to multi-byte characters in arguments and input
                 files).

       _L_C___M_E_S_S_A_G_E_S
                 Determine the locale that should be used to affect the format
                 and contents of diagnostic messages written to standard
                 error.

       _N_L_S_P_A_T_H   Determine the location of message catalogs for the processing
                 of _L_C___M_E_S_S_A_G_E_S.

       _T_M_P_D_I_R    Provide a pathname that should override the default directory
                 for temporary files, if any.  On XSI-conforming systems,
                 provide a pathname that shall override the default directory
                 for temporary files, if any.

AASSYYNNCCHHRROONNOOUUSS EEVVEENNTTSS
       Default.

SSTTDDOOUUTT
       If more than one _p_a_t_h_n_a_m_e operand ending in ..cc (or possibly other
       unspecified suffixes) is given, for each such file:

           ""%%ss::\\nn"",, <<_p_a_t_h_n_a_m_e>

       may be written. These messages, if written, shall precede the
       processing of each input file; they shall not be written to the
       standard output if they are written to the standard error, as described
       in the STDERR section.

       If the --EE option is specified, the standard output shall be a text file
       that represents the results of the preprocessing stage of the language;
       it may contain extra information appropriate for subsequent compilation
       passes.

SSTTDDEERRRR
       The standard error shall be used only for diagnostic messages.  If more
       than one _p_a_t_h_n_a_m_e operand ending in ..cc (or possibly other unspecified
       suffixes) is given, for each such file:

           ""%%ss::\\nn"",, <<_p_a_t_h_n_a_m_e>

       may be written to allow identification of the diagnostic and warning
       messages with the appropriate input file. These messages, if written,
       shall precede the processing of each input file; they shall not be
       written to the standard error if they are written to the standard
       output, as described in the STDOUT section.

       This utility may produce warning messages about certain conditions that
       do not warrant returning an error (non-zero) exit value.

OOUUTTPPUUTT FFIILLEESS
       Object files or executable files or both are produced in unspecified
       formats. If the pathname of an object file or executable file to be
       created by _c_9_9 resolves to an existing directory entry for a file that
       is not a regular file, it is unspecified whether _c_9_9 shall attempt to
       create the file or shall issue a diagnostic and exit with a non-zero
       exit status.

EEXXTTEENNDDEEDD DDEESSCCRRIIPPTTIIOONN
   SSttaannddaarrdd LLiibbrraarriieess
       The _c_9_9 utility shall recognize the following --ll options for standard
       libraries:

       --ll cc      This option shall make available all interfaces referenced in
                 the System Interfaces volume of POSIX.1-2008, with the
                 possible exception of those interfaces listed as residing in
                 _<_a_i_o_._h_>, _<_a_r_p_a_/_i_n_e_t_._h_>, _<_c_o_m_p_l_e_x_._h_>, _<_f_e_n_v_._h_>, _<_m_a_t_h_._h_>,
                 _<_m_q_u_e_u_e_._h_>, _<_n_e_t_d_b_._h_>, _<_n_e_t_/_i_f_._h_>, _<_n_e_t_i_n_e_t_/_i_n_._h_>,
                 _<_p_t_h_r_e_a_d_._h_>, _<_s_c_h_e_d_._h_>, _<_s_e_m_a_p_h_o_r_e_._h_>, _<_s_p_a_w_n_._h_>,
                 _<_s_y_s_/_s_o_c_k_e_t_._h_>, _p_t_h_r_e_a_d___k_i_l_l(), and _p_t_h_r_e_a_d___s_i_g_m_a_s_k() in
                 _<_s_i_g_n_a_l_._h_>, _<_t_r_a_c_e_._h_>, interfaces marked as optional in
                 _<_s_y_s_/_m_m_a_n_._h_>, interfaces marked as ADV (Advisory Information)
                 in _<_f_c_n_t_l_._h_>, and interfaces beginning with the prefix clock_
                 or time_ in _<_t_i_m_e_._h_>.  This option shall not be required to
                 be present to cause a search of this library.

       --ll ll      This option shall make available all interfaces required by
                 the C-language output of _l_e_x that are not made available
                 through the --ll cc option.

       --ll pptthhrreeaadd
                 This option shall make available all interfaces referenced in
                 _<_p_t_h_r_e_a_d_._h_> and _p_t_h_r_e_a_d___k_i_l_l() and _p_t_h_r_e_a_d___s_i_g_m_a_s_k()
                 referenced in _<_s_i_g_n_a_l_._h_>.  An implementation may search this
                 library in the absence of this option.

       --ll mm      This option shall make available all interfaces referenced in
                 _<_m_a_t_h_._h_>, _<_c_o_m_p_l_e_x_._h_>, and _<_f_e_n_v_._h_>.  An implementation may
                 search this library in the absence of this option.

       --ll rrtt     This option shall make available all interfaces referenced in
                 _<_a_i_o_._h_>, _<_m_q_u_e_u_e_._h_>, _<_s_c_h_e_d_._h_>, _<_s_e_m_a_p_h_o_r_e_._h_>, and _<_s_p_a_w_n_._h_>,
                 interfaces marked as optional in _<_s_y_s_/_m_m_a_n_._h_>, interfaces
                 marked as ADV (Advisory Information) in _<_f_c_n_t_l_._h_>, and
                 interfaces beginning with the prefix clock_ and time_ in
                 _<_t_i_m_e_._h_>.  An implementation may search this library in the
                 absence of this option.

       --ll ttrraaccee  This option shall make available all interfaces referenced in
                 _<_t_r_a_c_e_._h_>.  An implementation may search this library in the
                 absence of this option.

       --ll xxnneett   This option shall make available all interfaces referenced in
                 _<_a_r_p_a_/_i_n_e_t_._h_>, _<_n_e_t_d_b_._h_>, _<_n_e_t_/_i_f_._h_>, _<_n_e_t_i_n_e_t_/_i_n_._h_>, and
                 _<_s_y_s_/_s_o_c_k_e_t_._h_>.  An implementation may search this library in
                 the absence of this option.

       --ll yy      This option shall make available all interfaces required by
                 the C-language output of _y_a_c_c that are not made available
                 through the --ll cc option.

       In the absence of options that inhibit invocation of the link editor,
       such as --cc or --EE, the _c_9_9 utility shall cause the equivalent of a --ll cc
       option to be passed to the link editor after the last _p_a_t_h_n_a_m_e operand
       or --ll option, causing it to be searched after all other object files
       and libraries are loaded.

       It is unspecified whether the libraries lliibbcc..aa, lliibbll..aa, lliibbmm..aa,
       lliibbpptthhrreeaadd..aa, lliibbrrtt..aa, lliibbttrraaccee..aa, lliibbxxnneett..aa, or lliibbyy..aa exist as
       regular files. The implementation may accept as --ll option-arguments
       names of objects that do not exist as regular files.

   EExxtteerrnnaall SSyymmbboollss
       The C compiler and link editor shall support the significance of
       external symbols up to a length of at least 31 bytes; the action taken
       upon encountering symbols exceeding the implementation-defined maximum
       symbol length is unspecified.

       The compiler and link editor shall support a minimum of 511 external
       symbols per source or object file, and a minimum of 4095 external
       symbols in total. A diagnostic message shall be written to the standard
       output if the implementation-defined limit is exceeded; other actions
       are unspecified.

   HHeeaaddeerr SSeeaarrcchh
       If a file with the same name as one of the standard headers defined in
       the Base Definitions volume of POSIX.1-2008, _C_h_a_p_t_e_r _1_3, _H_e_a_d_e_r_s, not
       provided as part of the implementation, is placed in any of the usual
       places that are searched by default for headers, the results are
       unspecified.

   PPrrooggrraammmmiinngg EEnnvviirroonnmmeennttss
       All implementations shall support one of the following programming
       environments as a default. Implementations may support more than one of
       the following programming environments. Applications can use _s_y_s_c_o_n_f()
       or _g_e_t_c_o_n_f to determine which programming environments are supported.

                   TTaabbllee 44--44:: PPrrooggrraammmmiinngg EEnnvviirroonnmmeennttss:: TTyyppee SSiizzeess

          +------------------------+---------+---------+---------+---------+
          |PPrrooggrraammmmiinngg EEnnvviirroonnmmeenntt | BBiittss iinn | BBiittss iinn | BBiittss iinn | BBiittss iinn |
          |     _g_e_t_c_o_n_f NNaammee       |   iinntt   |  lloonngg   | ppooiinntteerr |  ooffff__tt  |
          +------------------------+---------+---------+---------+---------+
          |_POSIX_V7_ILP32_OFF32   |    32   |    32   |    32   |    32   |
          |_POSIX_V7_ILP32_OFFBIG  |    32   |    32   |    32   |  >=64   |
          |_POSIX_V7_LP64_OFF64    |    32   |    64   |    64   |    64   |
          |_POSIX_V7_LPBIG_OFFBIG  |  >=32   |  >=64   |  >=64   |  >=64   |
          +------------------------+---------+---------+---------+---------+
       All implementations shall support one or more environments where the
       widths of the following types are no greater than the width of type
       lloonngg:

                         bbllkkssiizzee__tt   ppttrrddiiffff__tt     ttccffllaagg__tt
                         cccc__tt        ssiizzee__tt        wwcchhaarr__tt
                         mmooddee__tt      ssppeeeedd__tt       wwiinntt__tt
                         nnffddss__tt      ssssiizzee__tt
                         ppiidd__tt       ssuusseeccoonnddss__tt

       The executable files created when these environments are selected shall
       be in a proper format for execution by the _e_x_e_c family of functions.
       Each environment may be one of the ones in _T_a_b_l_e _4_-_4_, _P_r_o_g_r_a_m_m_i_n_g
       _E_n_v_i_r_o_n_m_e_n_t_s_: _T_y_p_e _S_i_z_e_s, or it may be another environment. The names
       for the environments that meet this requirement shall be output by a
       _g_e_t_c_o_n_f command using the POSIX_V7_WIDTH_RESTRICTED_ENVS argument, as a
       <newline>-separated list of names suitable for use with the _g_e_t_c_o_n_f --vv
       option. If more than one environment meets the requirement, the names
       of all such environments shall be output on separate lines. Any of
       these names can then be used in a subsequent _g_e_t_c_o_n_f command to obtain
       the flags specific to that environment with the following suffixes
       added as appropriate:

       _CFLAGS   To get the C compiler flags.

       _LDFLAGS  To get the linker/loader flags.

       _LIBS     To get the libraries.

       This requirement may be removed in a future version.

       When this utility processes a file containing a function called _m_a_i_n(),
       it shall be defined with a return type equivalent to iinntt.  Using return
       from the initial call to _m_a_i_n() shall be equivalent (other than with
       respect to language scope issues) to calling _e_x_i_t() with the returned
       value. Reaching the end of the initial call to _m_a_i_n() shall be
       equivalent to calling _e_x_i_t(0).  The implementation shall not declare a
       prototype for this function.

       Implementations provide configuration strings for C compiler flags,
       linker/loader flags, and libraries for each supported environment.
       When an application needs to use a specific programming environment
       rather than the implementation default programming environment while
       compiling, the application shall first verify that the implementation
       supports the desired environment. If the desired programming
       environment is supported, the application shall then invoke _c_9_9 with
       the appropriate C compiler flags as the first options for the compile,
       the appropriate linker/loader flags after any other options except --ll
       but before any operands or --ll options, and the appropriate libraries at
       the end of the operands and --ll options.

       Conforming applications shall not attempt to link together object files
       compiled for different programming models. Applications shall also be
       aware that binary data placed in shared memory or in files might not be
       recognized by applications built for other programming models.

                 TTaabbllee 44--55:: PPrrooggrraammmmiinngg EEnnvviirroonnmmeennttss:: _c_9_9 AArrgguummeennttss

   +------------------------+---------------------+-------------------------------+
   |PPrrooggrraammmmiinngg EEnnvviirroonnmmeenntt |                     |         _c_9_9 AArrgguummeennttss         |
   |     _g_e_t_c_o_n_f NNaammee       |         UUssee         |         _g_e_t_c_o_n_f NNaammee          |
   +------------------------+---------------------+-------------------------------+
   |_POSIX_V7_ILP32_OFF32   | C Compiler Flags    | POSIX_V7_ILP32_OFF32_CFLAGS   |
   |                        | Linker/Loader Flags | POSIX_V7_ILP32_OFF32_LDFLAGS  |
   |                        | Libraries           | POSIX_V7_ILP32_OFF32_LIBS     |
   +------------------------+---------------------+-------------------------------+
   |_POSIX_V7_ILP32_OFFBIG  | C Compiler Flags    | POSIX_V7_ILP32_OFFBIG_CFLAGS  |
   |                        | Linker/Loader Flags | POSIX_V7_ILP32_OFFBIG_LDFLAGS |
   |                        | Libraries           | POSIX_V7_ILP32_OFFBIG_LIBS    |
   +------------------------+---------------------+-------------------------------+
   |_POSIX_V7_LP64_OFF64    | C Compiler Flags    | POSIX_V7_LP64_OFF64_CFLAGS    |
   |                        | Linker/Loader Flags | POSIX_V7_LP64_OFF64_LDFLAGS   |
   |                        | Libraries           | POSIX_V7_LP64_OFF64_LIBS      |
   +------------------------+---------------------+-------------------------------+
   |_POSIX_V7_LPBIG_OFFBIG  | C Compiler Flags    | POSIX_V7_LPBIG_OFFBIG_CFLAGS  |
   |                        | Linker/Loader Flags | POSIX_V7_LPBIG_OFFBIG_LDFLAGS |
   |                        | Libraries           | POSIX_V7_LPBIG_OFFBIG_LIBS    |
   +------------------------+---------------------+-------------------------------+
       In addition to the type size programming environments above, all
       implementations also support a multi-threaded programming environment
       that is orthogonal to all of the programming environments listed above.
       The _g_e_t_c_o_n_f utility can be used to get flags for the threaded
       programming environment, as indicated in _T_a_b_l_e _4_-_6_, _T_h_r_e_a_d_e_d
       _P_r_o_g_r_a_m_m_i_n_g _E_n_v_i_r_o_n_m_e_n_t_: _c_9_9 _A_r_g_u_m_e_n_t_s.

             TTaabbllee 44--66:: TThhrreeaaddeedd PPrrooggrraammmmiinngg EEnnvviirroonnmmeenntt:: _c_9_9 AArrgguummeennttss

      +------------------------+---------------------+--------------------------+
      |PPrrooggrraammmmiinngg EEnnvviirroonnmmeenntt |                     |      _c_9_9 AArrgguummeennttss       |
      |     _g_e_t_c_o_n_f NNaammee       |         UUssee         |       _g_e_t_c_o_n_f NNaammee       |
      +------------------------+---------------------+--------------------------+
      |_POSIX_THREADS          | C Compiler Flags    | POSIX_V7_THREADS_CFLAGS  |
      |                        | Linker/Loader Flags | POSIX_V7_THREADS_LDFLAGS |
      +------------------------+---------------------+--------------------------+
       These programming environment flags may be used in conjunction with any
       of the type size programming environments supported by the
       implementation.

EEXXIITT SSTTAATTUUSS
       The following exit values shall be returned:

        0    Successful compilation or link edit.

       >0    An error occurred.

CCOONNSSEEQQUUEENNCCEESS OOFF EERRRROORRSS
       When _c_9_9 encounters a compilation error that causes an object file not
       to be created, it shall write a diagnostic to standard error and
       continue to compile other source code operands, but it shall not
       perform the link phase and return a non-zero exit status. If the link
       edit is unsuccessful, a diagnostic message shall be written to standard
       error and _c_9_9 exits with a non-zero status. A conforming application
       shall rely on the exit status of _c_9_9, rather than on the existence or
       mode of the executable file.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       Since the _c_9_9 utility usually creates files in the current directory
       during the compilation process, it is typically necessary to run the
       _c_9_9 utility in a directory in which a file can be created.

       On systems providing POSIX Conformance (see the Base Definitions volume
       of POSIX.1-2008, _C_h_a_p_t_e_r _2, _C_o_n_f_o_r_m_a_n_c_e), _c_9_9 is required only with the
       C-Language Development option; XSI-conformant systems always provide
       _c_9_9.

       Some historical implementations have created ..oo files when --cc is not
       specified and more than one source file is given. Since this area is
       left unspecified, the application cannot rely on ..oo files being
       created, but it also must be prepared for any related ..oo files that
       already exist being deleted at the completion of the link edit.

       There is the possible implication that if a user supplies versions of
       the standard functions (before they would be encountered by an implicit
       --ll cc or explicit --ll mm), that those versions would be used in place of
       the standard versions.  There are various reasons this might not be
       true (functions defined as macros, manipulations for clean name space,
       and so on), so the existence of files named in the same manner as the
       standard libraries within the --LL directories is explicitly stated to
       produce unspecified behavior.

       All of the functions specified in the System Interfaces volume of
       POSIX.1-2008 may be made visible by implementations when the Standard C
       Library is searched. Conforming applications must explicitly request
       searching the other standard libraries when functions made visible by
       those libraries are used.

       In the ISO C standard the mapping from physical source characters to
       the C source character set is implementation-defined. Implementations
       may strip white-space characters before the terminating <newline> of a
       (physical) line as part of this mapping and, as a consequence of this,
       one or more white-space characters (and no other characters) between a
       <backslash> character and the <newline> character that terminates the
       line produces implementation-defined results. Portable applications
       should not use such constructs.

       Some _c_9_9 compilers not conforming to POSIX.1-2008 do not support
       trigraphs by default.

EEXXAAMMPPLLEESS
        1. The following usage example compiles ffoooo..cc and creates the
           executable file ffoooo:

               cc9999 --oo ffoooo ffoooo..cc

           The following usage example compiles ffoooo..cc and creates the object
           file ffoooo..oo:

               cc9999 --cc ffoooo..cc

           The following usage example compiles ffoooo..cc and creates the
           executable file aa..oouutt:

               cc9999 ffoooo..cc

           The following usage example compiles ffoooo..cc, links it with bbaarr..oo,
           and creates the executable file aa..oouutt.  It may also create and
           leave ffoooo..oo:

               cc9999 ffoooo..cc bbaarr..oo

        2. The following example shows how an application using threads
           interfaces can test for support of and use a programming
           environment supporting 32-bit iinntt, lloonngg, and ppooiinntteerr types and an
           ooffff__tt type using at least 64 bits:

               ooffffbbiigg__eennvv==$$((ggeettccoonnff __PPOOSSIIXX__VV77__IILLPP3322__OOFFFFBBIIGG))
               iiff [[ $$ooffffbbiigg__eennvv !!== ""--11"" ]] &&&& [[ $$ooffffbbiigg__eennvv !!== ""uunnddeeffiinneedd"" ]]
               tthheenn
                   cc9999 $$((ggeettccoonnff PPOOSSIIXX__VV77__IILLPP3322__OOFFFFBBIIGG__CCFFLLAAGGSS)) \\
                   $$((ggeettccoonnff PPOOSSIIXX__VV77__TTHHRREEAADDSS__CCFFLLAAGGSS)) --DD__XXOOPPEENN__SSOOUURRCCEE==770000 \\
                   $$((ggeettccoonnff PPOOSSIIXX__VV77__IILLPP3322__OOFFFFBBIIGG__LLDDFFLLAAGGSS)) \\
                   $$((ggeettccoonnff PPOOSSIIXX__VV77__TTHHRREEAADDSS__LLDDFFLLAAGGSS)) ffoooo..cc --oo ffoooo \\
                   $$((ggeettccoonnff PPOOSSIIXX__VV77__IILLPP3322__OOFFFFBBIIGG__LLIIBBSS)) \\
                   --ll pptthhrreeaadd
               eellssee
                   eecchhoo IILLPP3322__OOFFFFBBIIGG pprrooggrraammmmiinngg eennvviirroonnmmeenntt nnoott ssuuppppoorrtteedd
                   eexxiitt 11
               ffii

        3. The following examples clarify the use and interactions of --LL and
           --ll options.

           Consider the case in which module aa..cc calls function _f() in library
           lliibbQQ..aa, and module bb..cc calls function _g() in library lliibbpp..aa.
           Assume that both libraries reside in //aa//bb//cc.  The command line to
           compile and link in the desired way is:

               cc9999 --LL //aa//bb//cc mmaaiinn..oo aa..cc --ll QQ bb..cc --ll pp

           In this case the --LL option need only precede the first --ll option,
           since both lliibbQQ..aa and lliibbpp..aa reside in the same directory.

           Multiple --LL options can be used when library name collisions occur.
           Building on the previous example, suppose that the user wants to
           use a new lliibbpp..aa, in //aa//aa//aa, but still wants _f() from
           //aa//bb//cc//lliibbQQ..aa:

               cc9999 --LL //aa//aa//aa --LL //aa//bb//cc mmaaiinn..oo aa..cc --ll QQ bb..cc --ll pp

           In this example, the linker searches the --LL options in the order
           specified, and finds //aa//aa//aa//lliibbpp..aa before //aa//bb//cc//lliibbpp..aa when
           resolving references for bb..cc.  The order of the --ll options is still
           important, however.

        4. The following example shows how an application can use a
           programming environment where the widths of the following types:
           bbllkkssiizzee__tt, cccc__tt, mmooddee__tt, nnffddss__tt, ppiidd__tt, ppttrrddiiffff__tt, ssiizzee__tt, ssppeeeedd__tt,
           ssssiizzee__tt, ssuusseeccoonnddss__tt, ttccffllaagg__tt, wwcchhaarr__tt, wwiinntt__tt

           are no greater than the width of type lloonngg:

               ## FFiirrsstt cchhoooossee oonnee ooff tthhee lliisstteedd eennvviirroonnmmeennttss ......

               # ... if there are no additional constraints, the first one will do:
               CENV=$(getconf POSIX_V7_WIDTH_RESTRICTED_ENVS | head -n l)

               # ... or, if an environment that supports large files is preferred,
               # look for names that contain "OFF64" or "OFFBIG". (This chooses
               # the last one in the list if none match.)
               for CENV in $(getconf POSIX_V7_WIDTH_RESTRICTED_ENVS)
               do
                   case $CENV in
                   *OFF64*|*OFFBIG*) break ;;
                   esac
               done

               # The chosen environment name can now be used like this:

               c99 $(getconf ${CENV}_CFLAGS) -D _POSIX_C_SOURCE=200809L \
               $(getconf ${CENV}_LDFLAGS) foo.c -o foo \
               $(getconf ${CENV}_LIBS)

RRAATTIIOONNAALLEE
       The _c_9_9 utility is based on the _c_8_9 utility originally introduced in
       the ISO POSIX-2:1993 standard.

       Some of the changes from _c_8_9 include the ability to intersperse options
       and operands (which many _c_8_9 implementations allowed despite it not
       being specified), the description of --ll as an option instead of an
       operand, and the modification to the contents of the Standard Libraries
       section to account for new headers and options; for example, _<_s_p_a_w_n_._h_>
       added to the description of --ll rrtt, and --ll ttrraaccee added for the Tracing
       option.

       POSIX.1-2008 specifies that the _c_9_9 utility must be able to use regular
       files for **..oo files and for aa..oouutt files. Implementations are free to
       overwrite existing files of other types when attempting to create
       object files and executable files, but are not required to do so. If
       something other than a regular file is specified and using it fails for
       any reason, _c_9_9 is required to issue a diagnostic message and exit with
       a non-zero exit status. But for some file types, the problem may not be
       noticed for a long time. For example, if a FIFO named aa..oouutt exists in
       the current directory, _c_9_9 may attempt to open aa..oouutt and will hang in
       the _o_p_e_n() call until another process opens the FIFO for reading. Then
       _c_9_9 may write most of the aa..oouutt to the FIFO and fail when it tries to
       seek back close to the start of the file to insert a timestamp (FIFOs
       are not seekable files). The _c_9_9 utility is also allowed to issue a
       diagnostic immediately if it encounters an aa..oouutt or **..oo file that is
       not a regular file. For portable use, applications should ensure that
       any aa..oouutt, --oo option-argument, or **..oo files corresponding to any **..cc
       files do not conflict with names already in use that are not regular
       files or symbolic links that point to regular files.

       On many systems, multi-threaded applications run in a programming
       environment that is distinct from that used by single-threaded
       applications. This multi-threaded programming environment (in addition
       to needing to specify --ll pptthhrreeaadd at link time) may require additional
       flags to be set when headers are processed at compile time
       (--DD__RREEEENNTTRRAANNTT being common). This programming environment is orthogonal
       to the type size programming environments discussed above and listed in
       _T_a_b_l_e _4_-_4_, _P_r_o_g_r_a_m_m_i_n_g _E_n_v_i_r_o_n_m_e_n_t_s_: _T_y_p_e _S_i_z_e_s.  This version of the
       standard adds _g_e_t_c_o_n_f utility calls to provide the C compiler flags and
       linker/loader flags needed to support multi-threaded applications. Note
       that on a system where single-threaded applications are a special case
       of a multi-threaded application, both of these _g_e_t_c_o_n_f calls may return
       NULL strings; on other implementations both of these strings may be
       non-NULL strings.

       The C standardization committee invented trigraphs (e.g., ""????!!"" to
       represent ''||'') to address character portability problems in development
       environments based on national variants of the 7-bit ISO/IEC 646:1991
       standard character set. However, these environments were already
       obsolete by the time the first ISO C standard was published, and in
       practice trigraphs have not been used for their intended purpose, and
       usually are intended to have their original meaning in K&R C.  For
       example, in practice a C-language source string like ""WWhhaatt????!!"" is
       usually intended to end in two <question-mark> characters and an
       <exclamation-mark>, not in ''||''.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _S_e_c_t_i_o_n _1_._1_._1_._4, _F_i_l_e _R_e_a_d, _W_r_i_t_e, _a_n_d _C_r_e_a_t_i_o_n, _a_r, _g_e_t_c_o_n_f, _m_a_k_e, _n_m,
       _s_t_r_i_p, _u_m_a_s_k

       The Base Definitions volume of POSIX.1-2008, _C_h_a_p_t_e_r _8, _E_n_v_i_r_o_n_m_e_n_t
       _V_a_r_i_a_b_l_e_s, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s, _C_h_a_p_t_e_r _1_3, _H_e_a_d_e_r_s

       The System Interfaces volume of POSIX.1-2008, _e_x_e_c, _s_y_s_c_o_n_f()

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
       -- Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, Copyright (C) 2013 by the Institute of
       Electrical and Electronics Engineers, Inc and The Open Group.  (This is
       POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
       event of any discrepancy between this version and the original IEEE and
       The Open Group Standard, the original IEEE and The Open Group Standard
       is the referee document. The original Standard can be obtained online
       at http://www.unix.org/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2013                               C99(1)
