cc(1)
NAME
cc − C compiler
SYNTAX
cc [ option... ] file...
DESCRIPTION
The cc command invokes the ULTRIX C compiler. The cc command 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 substituted for .c. If a single C program is compiled and loaded all at one go, the .o file is deleted.
Arguments whose names end with .s are taken to be assembly source programs and are assembled, producing an .o file.
Other arguments are taken to be either loader option arguments, or C-compatible object programs, produced by an earlier cc run or by libraries of C-compatible routines.
OPTIONS
These options are accepted by cc. See ld(1) for load-time options.
−b Do not pass −lc to ld(1) by default.
−Bstring Find substitute compiler passes in the files named string with the suffixes cpp, ccom, and c2.
−c Suppress the loading phase of the compilation and force an object file to be produced even if only one program is compiled.
−C Stops the macro preprocessor from omitting comments.
−Dname=def
−Dname Define the name to the processor, as if by #define. If no definition is given, the name is defined as “1”.
−E Run only the macro preprocessor on the named C programs and send the result to the standard output.
−Em Run only the macro preprocessor on the named C programs and produce the makefile dependencies.
−f Specifies that computations involving only FFLOAT numbers be done in single precision and not promoted to double. Procedure arguments are still promoted to double. Programs with a large number of single-precision computations will run faster with this option; however, a slight loss in precision may result due to the saving of intermediate results in a single-precision representation.
−g Have the compiler produce additional symbol table information for dbx(1). Also pass the −lg flag to ld(1).
−Idir Seek “#include” files whose names do not begin with “/” first in the directory of the file argument, then in directories named in −I options, then in directories on a standard list.
−lx This option is an abbreviation for the library name ‘/lib/libx.a’, where x is a string. If that does not exist, ld tries ‘/usr/lib/libx.a’. If that does not exist, ld tries ‘/usr/local/lib/libx.a’. A library is searched when its name is encountered, so the placement of a −l is significant.
−M Specifies the floating point type to be used for double-precision floating point. Passed on to ld(1) as the map option.
−Md Specify DFLOAT (the default) and pass the −lc flag to ld(1).
−Mg Specify GFLOAT and pass the −lcg flag to ld(1) which causes the GFLOAT version of libc to be used. If the math library is used with code compiled with the −Mg flag, the GFLOAT version would be linked to by specifying −lmg on the cc(1) or ld(1) command.
−o output Name the final output file output. If this option is used, the file a.out will be left undisturbed. If the named file has an .o or .a suffix, the following error message is displayed: -o would overwrite.
−O Invoke an object-code improver.
−p Arrange for the compiler to produce code which counts the number of times each routine is called. If loading takes place, replace the standard startup routine with one which automatically calls monitor(3). 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 generated by use of prof(1).
−pg Causes the compiler to produce counting code in the manner of −p, but invokes a run-time recording mechanism that keeps more extensive statistics and produces a gmon.out file at normal termination. Also, a profiling library is searched, in lieu of the standard C library. An execution profile can then be generated by use of gprof(1).
−R Passed on to as, which makes initialized variables shared and read-only.
−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 string is taken to be /usr/c/.
−Uname Remove any initial definition of name.
−w Suppress warning diagnostics.
−Y Compile file for the System V environment. Defines SYSTEM_FIVE for the preprocessor, cpp, and if the loader is invoked, specifies that the System V version of the C runtime library is used. Also, if the math library is specified with the −lm option, the System V version will be used.
DEFAULT SYMBOLS
The ULTRIX C compiler provides the following default symbols for your use. These symbols are useful in ifdef statements to isolate code for one of the particular cases. Thus, these symbols can be useful for ensuring portable code.
unixAny UNIX system
bsd4_2Berkeley UNIX Version 4.2
ultrixULTRIX only
vaxVAX only (as opposed to PDP-11)
RESTRICTIONS
The compiler ignores advice to put char, unsigned char, short or unsigned short variables in registers.
If the −Mg flag is used to produce GFLOAT code, it must be used when compiling all the modules which will be linked. Use the −Mg flag if you use the cc command to indirectly invoke ld(1) to link the modules. If ld(1) is invoked directly, use the −lcg flag rather than −lc. If the math library is used, specify the −lmg flag rather than the −lm flag in order to use the GFLOAT version.
The compiler and the linker ld(1) cannot detect the use of mixed double floating point types. If you use them, your program’s results may be erroneous.
DIAGNOSTICS
The diagnostics produced by C are intended to be self-explanatory. Occasional messages may be produced by the assembler or loader.
FILES
file.cinput file
file.oobject file
a.outloaded output
/tmp/ctm?temporary
/lib/cpppreprocessor
/lib/ccomcompiler
/lib/c2optional optimizer
/lib/crt0.oruntime startoff
/lib/mcrt0.ostartoff for profiling
/usr/lib/gcrt0.ostartoff for gprof-profiling
/lib/libc.astandard library, see intro(3)
/usr/libcg.aGFLOAT version of the standard library, see intro(3)
/usr/lib/libc_p.aprofiling library, see intro(3)
/usr/includestandard directory for #include files
mon.outfile produced for analysis by prof(1)
gmon.outfile produced for analysis by gprof(1)