cc(1) DG/UX 4.30 cc(1)
NAME
cc - C language compiler
SYNOPSIS
cc [ option ] filename ...
DESCRIPTION
The cc command is the interface to the C compilation system.
The system conceptually consists of a preprocessor,
compiler, optimizer, silicon filter, assembler, and link-
editor. The cc command processes the supplied options and
then executes the various tools with the appropriate
arguments.
The gcc command accesses the GNU C compiler. For a further
description see gcc(1). The ghcc command accesses the Green
Hills C compiler; see ghcc(1). The Green Hills C compiler
is a separate product and may not exist on your system.
The cc command invokes gcc with the -traditional option.
This means that cc will attempt to support PCC features.
Facilities unique to gcc may not be accessible from the cc
command; instead you must use gcc directly.
The suffix of a filename argument indicates how the file is
to be treated. Files whose names end with .c are taken to
be C source programs and may be preprocessed, compiled,
optimized, filtered, assembled, and link-edited. The
compilation process may be stopped after the completion of
any pass if the appropriate options are supplied. If the
compilation process is allowed to complete the assembly
phase, then an object file is produced; the object file for
a source file called xyz.c is created in a file called
xyz.o. However, the .o file is normally deleted if a single
C program is compiled and loaded all at one go.
In the same way, arguments whose names end with .s are taken
to be assembly source programs, and may be assembled and
link-edited. (The assembler will filter the assembly source
program if needed: see as(1).) Files with names ending in
.i are taken to be preprocessed C source programs and may be
compiled, optimized, filtered, assembled, and link-edited.
Files whose names do not end in .c, .s, or .i are handed to
the link-editor.
By default, if an executable file is produced (i.e., the
link-edit phase is allowed to finish), the file is called
a.out. This default name can be changed with the -o option
(see below).
The following options are interpreted by cc:
Licensed material--property of copyright holder(s) Page 1
cc(1) DG/UX 4.30 cc(1)
-ansi
Compiles the source in accordance with rules for ANSI C
and flags violations. It also passes the -ansi option
to the linker if the link edit phase is performed.
-c Suppress the link edit phase of the compilation, and do
not remove any produced object files.
-f This option is ignored on 88000 systems. Floating-
point support is always present.
-g Cause the compiler to generate additional information
needed for the use of a debugger.
-o outfile
Use the name outfile, instead of the default a.out, for
the executable file produced. This is a link-editor
option and does not apply to files produced by the -S,
-c, or -P options.
-p Arrange for the compiler to produce code that counts
the number of times each routine is called: also, if
link-editing takes place, a profiled version of the
standard C library is linked, and monitor (see
monitor(3C)) is automatically called. A mon.out file
will then be produced on normal termination of the
program. An execution profile can then be generated by
use of prof. Default parameters to monitor ensure that
up to 600 call counts are captured and that each pc has
a corresponding histogram bucket in the mon.out file.
-q Unused. Reserved for additional profiling directives.
-E Preprocess the named C programs and send the result to
the standard output.
-F Unused. Reserved for additional optimization
directives.
-O Do compilation-phase optimization on .c or .i files.
This option will not affect .s files.
-P Preprocess the named C programs and leave the result in
corresponding files suffixed .i.
-S Compile and do not assemble or link-edit the named C
files. The assembly language output is left in
corresponding files suffixed .s.
-V Cause each invoked tool to print its version
information on the standard error output.
Licensed material--property of copyright holder(s) Page 2
cc(1) DG/UX 4.30 cc(1)
-v Print the invocation of each tool on the standard error
output.
-C Cause the preprocessing phase to pass along all
comments other than those on preprocessing directive
lines.
-H Cause pathnames of files included during preprocessing
to be printed on the standard error output.
-D name[=tokens]
Associate name with the specified tokens as if by a
#define preprocessor directive. If no =tokens is
specified, the token 1 is supplied.
-U name
Cause any definition of name to be forgotten, as if by
a #undef preprocessor directive. If the same name is
specified for both -D and -U, name is not defined,
regardless of the order of the options.
-I dir
Alter the search for included files whose names do not
begin with / to look in dir prior to the usual
directories. The directories for multiple -I options
are searched in the order specified.
-W c,arg1[,arg2...]
Hand off the argument(s) argi to phase c where c is one
of [ p02sacl ] indicating preprocessing, compilation,
optimization, filtering, assembly, COFF-to-legend
symbol-table translation, or link-editing phases,
respectively. For example, -W a,-m passes -m to the
assembler phase. The arguments on and off to the
silicon filter are interpreted by cc itself. By
default, filtering is off. It may be enabled by -W
s,on.
-Y items,dir
Specify a new directory dir for the location of the
tools and directories designated in the first argument.
items can consist of any grouping of the following
characters:
p preprocessor
0 compiler
2 optimizer
s silicon filter
Licensed material--property of copyright holder(s) Page 3
cc(1) DG/UX 4.30 cc(1)
a assembler
c COFF-to-legend translator
l link-editor
I directory searched last for include files (default
/usr/include)
L directory searched next to last for libraries (default
/usr/lib)
S directory containing the start-up object files (default
/usr/lib)
U directory searched last for libraries (default
/usr/lib)
If the location of a tool is being specified, then the new
pathname for the tool will be dir/tool. If more than one -Y
option is applied to any one item, the last occurrence
holds.
-B string
Construct pathnames for substitute preprocessor,
compiler, optimizer, silicon filter, assembler, COFF-
to-legend translator, and link-editor passes by
concatenating string with the appropriate suffix. If
string is empty it is taken to be /lib/o. -B is
obsolete; -Y should be used instead.
-t items
Find only the tools designated by items in the file
whose name is constructed by a -B option. In the
absence of a -B option, the prefix is taken to be
/lib/n. items can be zero or more letters from [
p02sacl ], designating the preprocessor, compiler,
optimizer, silicon filter, assembler, COFF-to-legend
translator, or link-editor. If items is empty (as in
`-t""'), all tools are designated.
The cc command passes any unrecognized options to ld without
any diagnostic (see ld(1) for descriptions of ld options).
Other arguments are taken to be C-compatible object programs
or libraries of C-compatible routines and are passed
directly to the link-editor. 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 (unless the -o link-editor option is used).
The standard C library is automatically available to the C
Licensed material--property of copyright holder(s) Page 4
cc(1) DG/UX 4.30 cc(1)
program. Other libraries must be specified explicitly using
the -l option with cc (see ld(1) for details).
Another aspect of C compilers is the default set of #define
statements. The following list provides the meaning of
symbols that are defined by default ("GNU" and "GH" indicate
those symbols defined by the GNU and Green Hills compilers,
respectively). When defined, the value is 1.
m88k
GNU, GH: The target system is a Motorola 88100.
unix
GNU, GH: Unix operating system.
DGUX
GNU, GH: DG/UX operating system.
ghs
GH: Compiled by the Green Hills compiler.
GNUC
GNU: Compiled by the GNU C compiler.
STDC
GNU, GH: ANSI features are assumed. Defined when
-ansi is given and by gcc when neither -traditional nor
-ansi is given.
STRICTANSI
GNU: Strict ANSI, no extensions. Defined by gcc when
-ansi is given.
OPTIMIZE
GNU: Code is being optimized.
CHARUNSIGNED
GNU: Characters are unsigned by default.
Additionally, when the compiler is not in strict ANSI mode
(ANSI prohibits predefined names that don't begin with
either two `_'s, or an `_' and an uppercase letter) the
following are also available:
m88k GNU, GH: Deprecated alternative of m88k.
unix GNU, GH: Deprecated alternative of unix.
DGUX GNU, GH: Deprecated alternative of DGUX.
ghs GH: Compiled by the Green Hills compiler without -ansi
Licensed material--property of copyright holder(s) Page 5
cc(1) DG/UX 4.30 cc(1)
Note that ghs and GNUC are mutually exclusive.
There are several macros you can define to control your
source and target environments when developing applications.
These macros control header files, function declarations,
binary formats, and other aspects of the source and target
environments. The macros are helpful when you are porting
applications to or from non-DG/UX systems such as BSD or
AT&T systems. The macros can also make development of
POSIX- or BCS-conformant applications easier. For
developing BCS-conformant applications, the SDE utility is
also helpful. See Porting Applications to the DG/UXTM
System and the sde-target(1), sdetab(4), and sde(5) manual
pages.
FILES
file.c C source file
file.i preprocessed C source file
file.o object file
file.s assembly language file
a.out link-edited output
TMPDIR/ctm* temporary files. TMPDIR is usually
/tmp but can be redefined by setting
the environment variable TMPDIR.
/usr/lib/gcc/gcc-cpp GNU preprocessor
/usr/lib/gcc/gcc-cc1 GNU C compiler
/bin/as assembler, as(1)
/bin/ld link editor, ld(1)
/bin/sifilter silicon filter, sifilter(1)
/bin/ctl COFF-to-legend translator, ctl(1)
/lib/crt0.o start-up routine
/lib/mcrt0.o profiling start-up routine
/lib/libc.a standard C library
SEE ALSO
as(1), ctl(1), gcc(1), ghcc(1), ld(1), sde-target(1),
sdetab(4), sde(5), sifilter(1).
Licensed material--property of copyright holder(s) Page 6