6.9;cc (c_compiler), revision 1.0, 03/30/92
cc (c_compiler) - compile a C program.
usage: cc source_file [-ac | -pic]
[-alnchk]
[-ansi | -nansi | -xansi]
[-b [pathname] | -nb]
[-bx pathname]
[-bss | -nbss]
[-cd | -ncd]
[-comchk | -ncomchk]
[-compress | -ncompress]
[-cond | -ncond]
[-cpp pathname]
[-cpu id]
[-db | -dbs | -dba | -ndb]
[-def name[=value]]
[-es | -esf [pathname]]
[-exp | -nexp]
[-frnd | -nfrnd]
[-idir pathname]
[-indexl | -nindexl]
[-info [level]]
[-inlib pathname]
[-l [pathname] | -nl]
[-map | -nmap]
[-msgs | -nmsgs]
[-natural | -nnatural]
[-nclines]
[-nfpra]
[-oldcpp]
[-opt [n]]
[-prasm | -nprasm]
[-prof]
[-runtype sys]
[-systype sys]
[-uline | -nuline]
[-undef name]
[-version]
[-warn | -nwarn]
DESCRIPTION
The C compiler translates a C source module into a binary object module,
which can be executed or used as input to the binder. Source files may
be a maximum of 32000 lines long. For more information on the C
compiler, see the Domain/C Language Reference.
You can typically improve run-time performance if you compile your code
using the -cpu option with a processor-specific id. Use an argument
appropriate to the CPU type of the machine(s) on which you will run the
executable file. The option -cpu mathchip, for example, generates
optimal code for the DSP90, DN330, DN560, DN570, DN580, DN2500, DN3000,
DN3500, DN4000, and DN4500 processors, and for the HP Apollo 9000 Series
400dl, 400s, and 400t. Use the cpuhelp utility to help you choose the
-cpu argument best suited to your needs. For information about this
utility, type "help cpuhelp".
Note:
There is a homonymous DM command: cc (create_copy) - create a copy
of an existing window. Type "help cc_dm" for details.
ARGUMENTS
source_file (required)
Specify the pathname of the source file to be compiled. If
the pathname ends with .c, you need not specify this
suffix. If it is absent, the compiler automatically
appends .c to the pathname before it searches for the
file. This argument must precede any options specified
(except for -version, which does not take a pathname).
OPTIONS
Default options are indicated by "(D)".
-ac Produce absolute code. This option is the default for
compilers that generate 680x0 code, and has no effect with
compilers that generate Series 10000 code. The
alternative option is -pic, which causes the compiler to
produce position-independent code.
-pic Produce position-independent object code. This option is
the default for compilers that generate Series 10000 code.
For compilers that generate 680x0 code, the default is
-ac.
-alnchk Display messages about alignment of structures. This
option is the default for compilers that generate Series
10000 code.
-ansi Compile and link with full ANSI semantics, including
expression evaluation that does not reorder across
parentheses (Section 3.3 of the ANSI standard). Issue
warnings for Domain extensions to the ANSI standard.
-nansi Do not compile with ANSI semantics.
-xansi (D) Support ANSI semantics except that the compiler may
reorder expressions across parentheses (associative law).
Allow Domain extensions. This mode is in effect by
default unless -ansi or -nansi is specified.
-b [pathname] (D)
Generate a binary object file at pathname.bin. If you
omit the pathname, the compiler appends .bin to the source
file's name in place of .c, and writes the binary to that
file. If the compilation fails due to a fatal error in
the source code, no binary file is produced, and any
existing binary file is renamed pathname.bin.bak. The
.bak version is deleted upon successful compilation. This
prevents a corrupted binary from overwriting a previous
working version.
-nb Suppress creation of an object file.
-bx pathname Generate a binary file that does not have the default .bin
suffix.
-bss Put uninitialized global variables in the .bss section of
the object file.
-nbss (D) Put uninitialized global variables in named sections.
-cd Compress debug information in the object file.
-ncd (D) Do not compress debug information in the object file.
-comchk Check for balanced comments and warn if comments are not
balanced.
-ncomchk (D) Suppress comment checking.
-compress (D) Store .data section object file data in compressed form.
-ncompress Store .data section object file data in uncompressed form.
-cpp pathname Specify an alternative filename for the preprocessor.
-cpu id Generate code for a particular class of processors. The
default id is mathlib_sr10 if you are compiling for a
680x0-based workstation, and a88k if you are compiling for
a Series 10000 workstation. Values for id are as follows:
mathlib_sr10
Code for workstations with a 68020
or 68030 microprocessor and a
68881 or 68882 floating-point
coprocessor, or with a 68040
microprocessor. Code compiled with this
argument runs on SR10.0, SR10.1, SR10.2,
SR10.3, and later versions of Domain/OS.
mathlib Code for workstations with a 68020
or 68030 microprocessor and a
68881 or 68882 floating-point
coprocessor, or with a 68040
microprocessor. It produces optimal
code for workstations with a 68040
microprocessor (425t, 433s, DN5500).
Code compiled with this argument runs only
on SR10.3 and later versions of Domain/OS.
Use mathlib_sr10 if your code must
also run on SR10.0, SR10.1, or SR10.2.
mathchip Optimal code for 68020- or 68030-based
3000 workstations with a 6888x floating-
580 point coprocessor (400t, 400s, 400dl,
570 DN4500, DN4000, DN3500, DN3000, DN2500,
560 DN580, DN570, DN560, DN330, DSP90). These
330 seven arguments generate identical code.
90 Use the mathchip argument; the other
arguments may become obsolete at a
future release.
a88k Series 10000 code
fpa1 Code for DN3000, DN4000, or DN4500
workstations with an FPA1 floating-
point accelerator unit
fpx Code for DN5xx workstations with an
FPX floating-point accelerator unit
peb Code for workstations (including DN100,
DN320, DN400, DN600) with a Performance
Enhancement Board
160 Code for a DSP160, DN460, or DN660
460 workstation. These three arguments
660 generate identical code.
any Series 10000 code, if you are compiling
for a Series 10000 workstation, or
generic 680x0 code, if you are
compiling for a 680x0-based workstation
m68k Generic 680x0-based code. Same as
-cpu any for all machines other than
Series 10000 workstations
Using a processor-specific code generation mode can result
in programs that run faster. Using an argument of
mathlib_sr10 or any allows your program to run on a wider
variety of platforms with some performance loss. Use the
cpuhelp utility to help you choose the -cpu argument best
suited to your needs. For information about this utility,
type "help cpuhelp".
-db (D) Generate minimal debugging information.
-dbs Generate full run-time debugging information needed for
using dde(1).
-dba Identical to -dbs except that no optimization is performed
(even less than with -opt 0), even if you also specify
-opt.
-ndb Do not generate any debugging information.
-def name[=value]
Define a name, with an optional value, for the
preprocessor. The default value is 1. Spaces may be used
in the definition only if the entire definition is
enclosed in quotes. Up to 128 -def options may be given.
The -def option has lower precedence than -undef; if you
use both for the same name, the name is undefined,
regardless of the order in which the options appear.
-es Write the preprocessed expanded source to standard output.
-esf [pathname]
Write the preprocessed expanded source to a file that has
the same name as the source file, but with the suffix .i
replacing .c. If you specify a pathname, the compiler
uses that name and automatically appends the .i suffix,
unless it is already present.
-exp Generate expanded code listing (implies -l).
-nexp (D) Suppress expanded code listing.
-frnd Round floating-point numbers at key points during program
execution. Using this option may result in a loss of
performance.
-nfrnd (D) Optimize execution by computing floating-point expressions
in greater precision than that specified by the program,
when the compiler detects an opportunity to do so.
-idir pathname Add a pathname to the search hierarchy of directories for
include file names.
-indexl Use 32-bit indexing for all array references.
-nindexl (D) Use the source code's array dimension information to
determine whether to use 16-bit or 32-bit indexing.
-info [level] Control the output of informational messages. The four
informational levels are 0, 1, 2 and 3. -info 0 is the
default; it suppresses informational messages. -info with
no argument is the same as -info 2.
-inlib pathname
Specify one or more libraries that are not currently
installed but should be installed when the program is
executed. These libraries are searched at compile time to
determine whether indirect or absolute references should
be generated.
-l [pathname] Generate a compilation listing. If no pathname is
specified, the listing is written to a file that has the
same base name as the object file, but with the suffix
.lst replacing .c.
-nl (D) Suppress compilation listing.
-map Generate a symbol table map (implies -l).
-nmap (D) Suppress symbol table map.
-msgs (D) Force compiler to print a final message listing numbers of
errors, warnings, and informational messages, and the
version of the compiler being used.
-nmsgs Suppress final compilation message.
-natural Use natural alignment for structures and array elements
that do not have alignment attributes.
-nnatural (D) Use word alignment for structures and array elements that
do not have alignment attributes.
-nclines Suppress the generation of COFF line number tables. This
option has no effect on compilers that generate Series
10000 code.
-nfpra Suppress the reordering of operands in floating-point
expressions at optimization level 4.
-oldcpp Use the pre-ANSI preprocessor. -oldcpp is the default
with the -nansi option.
-opt [n] (D) Perform global optimization. n is a single-digit integer
in the range 0 to 4, indicating the level of optimization
performed. If n is omitted, or if the option is not
specified, 3 is the default level. Increasing the
optimization level results in faster execution of your
program, at the expense of longer compilation time. See
the Domain/C Language Reference for details.
-prasm (D) Use Series 10000 assembly language format for the expanded
listing generated by -exp.
NOTE: this option has no effect if used without the -exp
option or if you use it with a compiler that generates
code for 680x0-based workstations.
-nprasm Use an alternate version of Series 10000 assembly language
format for the expanded listing generated by -exp. NOTE:
This option has no effect if used without the -exp option
or if you use it with a compiler that generates code for
680x0-based workstations.
-prof Produce code that, when executed, produces a .mon file
that can be used by the prof utility to evaluate
performance. (The -prof option automatically activates
the -ncompress option. If you specify -compress in
conjunction with -prof, profiling will not work
correctly.)
-runtype sys Cause the compiler to use the run-time semantics of the
specified systype, sys, regardless of the current
environment setting. For valid sys arguments, see the
-systype option.
-std Issue warning messages for Domain extensions to C.
-nstd (D) Do not issue warning messages for Domain extensions to C.
-systype sys Set the UNIX system type. Valid sys arguments are:
TYPE DESCRIPTION
sys5.3 UNIX System V.3
bsd4.3 Berkeley version 4.3
any Program is independent of a particular
UNIX system
The -systype option specifies which UNIX file system will
be used at run time (/bsd4.3 or /sys5.3). It also
specifies which run-time library (SysV or BSD) will be
used at run time if you do not specify the -runtype
option.
NOTE: If you specify -systype any, calls that have
different semantics in each UNIX environment may not work
as expected. To insure proper behavior, specify a run-
time environment with the -runtype option.
-undef name Remove any initial definition of the macro name.
-version Print the version number of the compiler. If you use this
option, do not include a source filename.
-warn (D) Display warning messages.
-nwarn Suppress warning messages.
NOTES
The following options are obsolete: -cond, -ncond, -nstdc, -type,
-ntype, -uline, and -nuline.
EXAMPLES
If there are no errors in the source code and the compilation proceeds
normally, the C compiler outputs an object file and an optional listing
file. Unless you specify otherwise (with the -b option), the object
module file has the same name as the source file, except that .bin
replaces .c as the suffix. Similarly, .lst replaces .c in the listing
file name. Thus, in response to the command
$ cc plot_data -l
the C compiler reads the file plot_data.c and produces an object file
named plot_data.bin and a listing file named plot_data.lst. If errors
occur during compilation, the compiler writes diagnostic messages to
error output and flags the incorrect statements in the listing file.