Compile one or more C source files (
assembler source files (
or preprocessed C source files (
cc automatically invokes the link editor ld
(unless -c is supplied).
In some cases, cc generates an object file
having a .o suffix and a corresponding root name.
By default, output is placed in a.out.
cc accepts additional system-specific options.
Note: This command runs the ANSI C compiler;
use /usr/bin/cc if you want to run the compiler for
Kernighan and Ritchie's C.
Show when each compiler tool is invoked. Solaris 2.0 only.
Supply an #assert directive, assigning
name with optional
tokens as parameters.
Ignore predefined assertions and macros.
Use with one or more -l options to tell ld what type of library
files to search. When
mode is dynamic, libraries are shared,
meaning that library files ending in both .so and .a are searched.
mode is static, only .a files are searched.
To restore the previous search mode for additional -l options,
supply -B again and change its
Do not strip comments during preprocessing.
Suppress link editing and keep any object files that were produced.
Supply a #define directive, defining
name to be
or, if no
def is given, the value 1.
Tell ld to link dynamically when
c is y (the default)
or to link statically when
c is n.
Produce double load/store instructions to improve performance. Solaris 2.0 only.
Run only the macro preprocessor, sending results to standard output.
Use cc options that give fastest compilation. Solaris 2.0 only.
Briefly describe available options. Solaris 2.0 only.
Produce SIGFPE signals for floating-point overflows and division by zero. Solaris 2.0 only.
Evaluate float expressions as single-precision. Solaris 2.0 only.
Produce a shared object instead of a dynamically linked executable.
Generate more symbol-table information needed for debuggers dbx (Solaris) or sdb (SVR4).
List (on standard error) the pathnames of header files used in C
Search for include files in directory
dir (in addition
to standard locations). Supply a -I for each new
to be searched.
word is PIC, produce position-independent code;
word is minabi, compile with the minimum dynamic linking
that preserves ABI conformance.
Don't delete temporary files. Solaris 2.0 only.
Like -I, but search
dir for library archives.
file with library files
name.so or lib
Optimize object code (produced by .c or .i files).
Send object output to
file instead of to a.out.
Run only the preprocessor and place the result in
List in the output (
c = y) or do not list (
c = n)
information about the compilation tools invoked. Default is to list.
Invoke the basic block analyzer and produce code to count the times each source line is executed. Use lprof to list the counts.
Same as -p.
Compile (and optimize, if -O is supplied),
but don't assemble or link; assembler output is placed in
Remove definition of name, as if through an #undef directive.
Print version information for compiler tools.
Check semantics strictly, and allow some lint constructs to work.
Each comma-separated argument is a command-line token (option, parameter) from cc. -W hands off these arguments to allow separate processing by a particular compiler tool. p or 0 specifies the compiler; 2, optimizer; b, basic block analyzer; a, assembler; l, link editor.
c as the level of ANSI C compliance:
Transition (default). Source code must comply with pre-ANSI features.
ANSI. Code must comply with ANSI features, but doesn't warn about new escape sequences or trigraphs.
Conformance. More rigorous than a.
Code is allowed to be old Sun C. Solaris 2.0 only.
Produce symbol-table data for Source Code Browser. Solaris 2.0 only.
Same as -xsb, but don't actually compile. Solaris 2.0 only.
Add string literals to text segment, not data segment. Solaris 2.0 only.
Specify that item
c is searched in directory
c can be p, 0, 2, a, b, or l,
as explained under -W.
c can also be:
Include files to search last for (see -I).
dir is a list of directories, separated by a colon
Startup object files.
Compile xpop.c and link it to the X libraries:
cc -o xpop xpop.c -lXaw -lXmu -lXt -lX11