CC(1) UNIX Programmer's Manual CC(1) NAME cc - C compiler SYNOPSIS cc [ option ] ... file ... HP-UX COMPATIBILITY Level: C Compiler - HP-UX/DEVELOPMENT Origin: System III DESCRIPTION _C_c is the HP-UX C compiler. It accepts several types of arguments: Arguments whose names end with .c are taken to be C source programs; they are compiled, and each object program is left on the file whose name is that of the source with .o substi- tuted for .c. The .o file is normally deleted, however, if a single C program is compiled and linked all in one step. In the same way, arguments whose names end with .s are taken to be assembly source programs and are assembled, producing a .o file. Arguments whose names end with .o are taken to be relocat- able object files which are to be included in the link operation. The following options are interpreted by _c_c. Options may not be concatenated. See _l_d(1) for link editor options. -B_s_t_r_i_n_g Find substitute compiler passes in the files named _s_t_r_i_n_g with the suffixes cpp, ccom, c1 and c2. _S_t_r_i_n_g must be specified for -B to be mean- ingful. -c Suppress the link edit phase of the compilation, and force an object (.o) file to be produced even if only one program is compiled. Produces a .o file for each .c file. -E Run only the macro preprocessor on the named C programs, and send the result to the standard output. The result is compatible with the /_l_i_b/_c_c_o_m step of _c_c. -g Cause the compiler to generate additional infor- mation needed for the use of a symbolic debugger. -O Invoke an object-code optimizer. -p Arrange for the compiler to produce code which counts the number of times each routine is called; also, if link editing takes place, replace the standard startoff routine by one which automatically calls _m_o_n_i_t_o_r(3C) at the start and arranges to write out a mon.out file at normal termination of execution of the object program. An execution profile can then be gen- erated by use of _p_r_o_f(1). -P Similar to the -E option above, but the output goes to a corresponding file suffixed with .i which is suitable for compilation later. No compilation is done. -S Compile the named C programs, and leave the assembler-language output on corresponding files suffixed .s. -t[p012] Find only the designated compiler passes in the files whose names are constructed by a -B option. In the absence of a -B option, the _s_t_r_i_n_g is taken to be /lib/n. Any or all of the pass designators p, 0, 1, or 2 may be specified, with the following meanings: p - preprocessor; 0 - first pass of C compiler; 1 - second pass of C compiler; 2 - optimizer. -v Enables verbose mode, which produces on _s_t_d_o_u_t a step-by-step description of the compilation pro- cess. -C -D_n_a_m_e = _d_e_f -D_n_a_m_e -H _n_n_n -I_d_i_r -T -U_n_a_m_e These options are passed through to the C preprocessor, _c_p_p. Refer to _c_p_p(1) for details. Other arguments are taken to be either link editor option arguments, or C-compatible object programs, typically pro- duced by an earlier _c_c 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. The Kernighan and Ritchie C text, and the various addenda to it, comprise the best available reference on C. The docu- ments are intentionally ambiguous in some areas. HP-UX specifies some of these. char The char type is treated as signed by default. It may be declared unsigned. pointers Dereference of a NULL (zero) pointer is illegal and may cause a SIGSEGV error. This applies whether the access is for reading or writing. Some implementations may not be able to detect this error, in this case the result of such an access is undefined. Programs which rely on being able to derefrence a null pointer are not considered portable within HP-UX. identifiers Identifiers are significant up to (at least) 255 charac- ters. Whether or not longer identifiers are handled is machine dependent. The assembler and loader must also support long identifiers to 255 characters. HARDWARE DEPENDENCIES Series 200: The -g option is not currently supported. Identifiers longer than 255 characters are not sup- ported. The following additional options are supported: -a this option is passed directly to the assem- bler, _a_s(1). Refer to _a_s(1) for details. -b causes the compiler to generate code for floating point operations that will use floating point hardware if it is installed in the computer at run-time. -f causes the compiler to generate code for floating point operations that will use floating point hardware. This code will not run unless floating point hardware is installed at run-time. -N<_s_e_c_o_n_d_a_r_y><_n> This option adjusts the size of internal com- piler tables. The compiler uses fixed size arrays for certain internal tables. _S_e_c_o_n_- _d_a_r_y is one of the letters from the set {dpw}, and _n is an integer value. _S_e_c_o_n_d_a_r_y and _n are not optional. The table sizes can be re-specified using one of the secondary letters and the number _n as follows: d max size of the dimtab table. This table maintains information about the definitions of all structures, unions, and arrays. Default = 1000 table entries. p max size of the parameter stack. Default = 150 table entries. w max size of the switch table stack. Default = 250 table entries. Two additional pass designators are available for the -t option. They are: a assembler; l linker; Series 500: The -p option is not currently supported. An additional option, -F, is supported. The -F option causes the compiler to generate information for use by various program analysis commands. The _l_d options p and v conflict with _c_c options, and thus cannot be accessed via _c_c. The -B option is supported, but no substitute compiler passes are provided. The file /lib/mcrt0.o is not currently supported. Identifiers longer than 255 characters are not sup- ported. FILES file.c input file file.o object file a.out linked output /tmp/ctm* temporary /lib/cpp preprocessor /lib/ccom compiler, _c_c /lib/c2 optional optimizer /lib/crt0.o runtime startoff /lib/mcrt0.o startoff for profiling /lib/libc.a standard library, see section 3 of this manual /usr/include standard directory for #include files SEE ALSO B. W. Kernighan and D. M. Ritchie, _T_h_e _C _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, Prentice-Hall, 1978. as(1), ld(1), prof(1), monitor(3C). DIAGNOSTICS The diagnostics produced by C itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or the link editor.