gcc(1) DG/UX 4.30 gcc(1)
NAME
gcc - GNU C language compiler
SYNOPSIS
gcc [ option ] ... file ...
DESCRIPTION
The GNU C compiler uses a command syntax much like the Unix
C compiler. The gcc program accepts options and file names
as operands. Multiple single-letter options may not be
grouped: `-dr' is very different from `-d -r'. When you
invoke gcc, it normally does preprocessing, compilation,
assembly and linking. File names that end in .c are taken
as C source to be preprocessed and compiled; compiler output
files plus any input files with names ending in .s are
assembled; then the resulting object files, plus any other
input files, are linked together to produce an executable.
Command options allow you to stop this process at an
intermediate stage. For example, the -c option says not to
run the linker. Then the output consists of object files
output by the assembler. Other command options are passed
on to one stage. Some options control the preprocessor and
others the compiler itself.
OPTIONS
Here are the options to control the overall compilation
process, including those that say whether to link, whether
to assemble, and so on.
-o file
Place linker output in file file. This applies to any
output being produced, whether it be an executable
file, an object file, an assembler file or preprocessed
C code. If -o is not specified, the default is to put
an executable file in a.out, the object file source.c
in source.o, an assembler file in source.s, and
preprocessed C on standard output.
-c Compile or assemble the source files, but do not link.
Produce object files with names made by replacing .c or
.s with .o at the end of the input file names. Do
nothing at all for object files specified as input.
-S Compile into assembler code but do not assemble. The
assembler output file name is made by replacing .c with
.s at the end of the input file name. Do nothing at
all for assembler source files or object files
specified as input.
-E Run only the C preprocessor. Preprocess all the C
source files specified and output the results to
standard output.
Licensed material--property of copyright holder(s) Page 1
gcc(1) DG/UX 4.30 gcc(1)
-v Compiler driver program prints the commands it executes
as it runs the preprocessor, compiler proper, assembler
and linker. Some of these are directed to print their
own version numbers.
-pipe
Run preprocessor, compiler, silicon filter, and
assembler in parallel, connected via pipelines. You
should not use this option if your system does not have
enough physical memory to support all four processes
simultaneously.
-Bprefix
Compiler driver program tries prefix as a prefix for
each program it tries to run. These programs are cpp,
cc1, as and ld. For each subprogram to be run, the
compiler driver first tries the -B prefix, if any. If
that name is not found, or if -B was not specified, the
driver tries the standard prefix, which is
/usr/lib/gcc/gcc-. If this does not result in a file
name that is found, the unmodified program name is
searched for, using the directories specified in your
PATH environment variable.
The run-time support file gnulib is also searched for,
using the -B prefix, if needed. If it is not found
there, the standard prefix above is tried, and that is
all. The file is left out of the link if it is not
found by those means.
You can get a similar result from the environment
variable GCCEXECPREFIX. If it is defined, its value
is used as a prefix in the same way. If both the -B
option and the GCCEXECPREFIX variable are present,
the -B option is used first and the environment
variable value second.
These options control the C preprocessor, which is run on
each C source file before actual compilation. If you use
the -E option, nothing is done except C preprocessing. Some
of these options make sense only together with -E because
they request preprocessor output that is not suitable for
actual compilation.
-C Tell the preprocessor not to discard comments. Used
with the -E option.
-Idir
Search directory dir for include files.
-I- Any directories specified with -I options before the
-I- option are searched only for the case of `#include
Licensed material--property of copyright holder(s) Page 2
gcc(1) DG/UX 4.30 gcc(1)
"file"'; they are not searched for `#include <file>'.
If additional directories are specified with -I options
after the -I-, these directories are searched for all
#include directives. (Ordinarily all -I directories
are used this way.) In addition, the -I- option
inhibits the use of the current directory as the first
search directory for `#include "file"'. Therefore, the
current directory is searched only if it is requested
explicitly with `-I.'. Specifying both `-I-' and `-I.'
allows you to control precisely which directories are
searched before the current one and which are searched
after.
-nostdinc
Do not search the standard system directories for
header files. Only the directories you have specified
with -I options (and the current directory, if
appropriate) are searched. Between -nostdinc and -I-,
you can eliminate all directories from the search path
except those you specify.
-M Tell the preprocessor to output a rule suitable for
make describing the dependencies of each source file.
For each source file, the preprocessor outputs one
make-rule whose target is the object file name for that
source file and whose dependencies are all the files
#included in it. This rule may be a single line or may
be continued with `\'-newline if it is long. -M
implies -E.
-MM Like -M, but the output mentions only the user-header
files included with `#include "file".' System header
files included with `#include <file>' are omitted. -MM
implies -E.
-H Tell the preprocessor to output the names of include
files to the standard error file, in addition to the
normal processing.
-Dmacro
Define macro macro with the empty string as its
definition.
-Dmacro=defn
Define macro macro as defn.
-Umacro
Undefine macro macro.
-trigraphs
Support ANSI C trigraphs. The -ansi option also has
this effect.
Licensed material--property of copyright holder(s) Page 3
gcc(1) DG/UX 4.30 gcc(1)
These options control the details of C compilation itself.
-ansi
Support all ANSI standard C programs. This turns off
certain features of GNU C that are incompatible with
ANSI C, such as the asm, inline and typeof keywords,
and predefined macros such as unix that identify the
type of system you are using. It also enables the
rarely-used ANSI trigraph feature.
The -ansi option does not cause non-ANSI programs to be
rejected gratuitously. For that, -pedantic is required
in addition to -ansi. The macros STRICTANSI and
STDH are predefined when the -ansi option is used.
Some header files may notice this macro and refrain
from declaring certain functions or defining certain
macros that the ANSI standard doesn't call for; this is
to avoid interfering with any programs that might use
these names for other things.
-traditional
Attempt to support some aspects of traditional C
compilers. Specifically:
* All extern declarations take effect globally even if
they are written inside a function definition. This
includes implicit declarations of functions.
* The keywords typeof, inline, signed, const and
volatile are not recognized.
* Comparisons between pointers and integers are always
allowed.
* Integer types unsigned short and unsigned char
promote to unsigned int.
* Out-of-range floating point literals are not an
error.
* All automatic variables not declared register are
preserved by longjmp. Ordinarily, GNU C follows ANSI
C: automatic variables not declared volatile may be
clobbered.
* In the preprocessor, comments convert to nothing at
all, rather than to a space. This allows traditional
token concatenation.
* In the preprocessor, macro arguments are recognized
within string constants in a macro definition (and
their values are stringified, though without
Licensed material--property of copyright holder(s) Page 4
gcc(1) DG/UX 4.30 gcc(1)
additional quote marks, when they appear in such a
context). The preprocessor also considers a string
constant to end at a newline.
* The predefined macro STDC is not defined when you
use -traditional, but GNUC is (since the GNU
extensions which GNUC indicates are not affected
by -traditional). If you need to write header files
that work differently depending on whether
-traditional is in use, by testing both of these
predefined macros you can distinguish four
situations: GNU C, traditional GNU C, other ANSI C
compilers, and other old C compilers.
* String literals are put into the writable data
section instead of into read-only text.
-O Optimize. Optimizing compilation takes somewhat more
time, and a lot more memory for a large function.
Without -O, the compiler's goal is to reduce the cost
of compilation and to make debugging produce the
expected results. Statements are independent: if you
stop the program with a breakpoint between statements,
you can then assign a new value to any variable or
change the program counter to any other statement in
the function and get exactly the results you would
expect from the source code. Without -O, only
variables declared register are allocated in registers.
With -O, the compiler tries to reduce code size and
execution time. Some of the -f options described below
turn specific kinds of optimization on or off.
-g Produce debugging information for sdb, in the operating
system's native format. Unlike most other C compilers,
GNU C allows you to use -g with -O.
The shortcuts taken by optimized code may occasionally
produce surprising results: some variables you declared
may not exist at all; flow of control may briefly move
where you did not expect it; some statements may not be
executed because they compute constant results or their
values were already at hand; some statements may
execute in different places because they were moved out
of loops. Nevertheless it proves possible to debug
optimized output. This makes it reasonable to use the
optimizer for programs that might have bugs.
-w Inhibit all warning messages.
-W Print extra warning messages for these events:
Licensed material--property of copyright holder(s) Page 5
gcc(1) DG/UX 4.30 gcc(1)
* An automatic variable is used without first being
initialized. These warnings are possible only in
optimizing compilation, because they require data
flow information that is computed only when
optimizing. They occur only for variables that are
candidates for register allocation. Therefore, they
do not occur for a variable that is declared
volatile, or whose address is taken, or whose size is
other than 1, 2, 4, or 8 bytes. Also, they do not
occur for structures, unions or arrays, even when
they are in registers. Note that there may be no
warning about a variable that is used only to compute
a value that itself is never used, because such
computations may be deleted by the flow analysis pass
before the warnings are printed. These warnings are
made optional because GNU C is not smart enough to
see all the reasons why the code might be correct
despite appearing to have an error.
* A nonvolatile automatic variable might be changed by
a call to longjmp. These warnings as well are
possible only in optimizing compilation. The
compiler sees only the calls to setjmp. It cannot
know where longjmp will be called; in fact, a signal
handler could call it at any point in the code. As a
result, you may get a warning even when there is in
fact no problem because longjmp cannot in fact be
called at the place which would cause a problem.
* A function can return either with or without a value.
(Falling off the end of the function body is
considered returning without a value.) Spurious
warnings can occur because GNU C does not realize
that certain functions (including abort and longjmp)
will never return.
* An expression-statement contains no side effects.
-Wimplicit
Warn whenever a function is implicitly declared.
-Wreturn-type
Warn whenever a function is defined with a return-type
that defaults to int. Also warn about any return
statement with no return-value in a function whose
return-type is not void.
-Wunused
Warn whenever a local variable is unused aside from its
declaration.
-Wcomment
Licensed material--property of copyright holder(s) Page 6
gcc(1) DG/UX 4.30 gcc(1)
Warn whenever a comment-start sequence `/*' appears in
a comment.
-Wall
All of the above -W options combined.
-Wwrite-strings
Give string constants the type const char[length] so
that copying the address of one into a non-const char *
pointer will get a warning. These warnings will help
you find at compile time code that can try to write
into a string constant, but only if you have been very
careful about using const in declarations and
prototypes. Otherwise, it will just be a nuisance;
this is why -Wall does not request these warnings.
-p Generate extra code to write profile information
suitable for the analysis program prof.
-llibrary
Search a standard list of directories for a library
named library, which is actually a file named
liblibrary.a. The linker uses this file as if it had
been specified precisely by name. The directories
searched include several standard system directories
plus any that you specify with -L. Normally the
filescd /udd/lsd/g++/sources/g++-1.37.1 found this way
are library files--archive files whose members are
object files. The linker handles an archive file by
scanning through it for members which define symbols
that have so far been referenced but not defined. But
if the file that is found is an ordinary object file,
it is linked in the usual fashion. The only difference
between an -l option and specifying a file name is that
-l searches several directories.
-Ldir
Add directory dir to the list of directories to be
searched for -l.
-nostdlib
Don't use the standard system libraries and startup
files when linking. Only the files you specify (plus
gnulib) will be passed to the linker.
-mmachinespec
Machine-dependent option specifying something about the
type of target machine. These options are defined by
the macro TARGETSWITCHES in the machine description.
The default for the options is also defined by that
macro, which enables you to change the defaults.
Licensed material--property of copyright holder(s) Page 7
gcc(1) DG/UX 4.30 gcc(1)
These are the -m options defined in the 88000 machine
description:
-mocs-debug-info
Put out additional debug information to comply
with the 88open Object Compatibility Standard text
description information. This is the default.
-mno-ocs-debug-info
Do not put out any additional debugging
information.
-mocs-frame-position
When emitting debugging information for automatic
variables and parameters stored on the stack, use
the offset from the canonical frame address (CFA),
which is the stack pointer (register 31) when the
function is entered. The CFA is specified by the
88open Object Compatibility Standard. This is the
default behavior of GNU C.
-mno-ocs-frame-position
When emitting debugging information for automatic
variables and parameters stored on the stack, use
the offset from the frame pointer register
(register 30). When this option is in effect, no
automatic frame pointer elimination is done when
debugging information is selected by the -g
switch.
-midentify-revision
Emit an assembly ident directive which gives the
filename, date, time, and compiler revision, for
use with the what command.
-mwarn-passed-structs
Emit a warning message if a structure is passed to
a function, or declared as a function argument.
This warns about the places where gcc will not
interoperate with compilers that do not pass
structures according to the 88open Object
Compatibility Standard.
-mwarn-changes
Emit a warning message for a construct that may
result in generation of an object module that will
not interoperate with objects produced with a
previous revision of GNU C.
-mno-underscores
Do not emit a leading underscore before all
external names. This switch is useful for
Licensed material--property of copyright holder(s) Page 8
gcc(1) DG/UX 4.30 gcc(1)
embedded systems and does not allow interoperation
with the standard library.
-mtrap-large-shift
Emit a tbnd instruction before each shift by a
non-constant amount, to trap if the shift count is
less than zero or greater than 31. The 88000
produces unusual results in such cases, and the
trap will halt the program at the point an out of
range shift is done, rather than producing
unexpected results. The ANSI standard for C
specifies that shifts outside of the range of 0 to
number_bits - 1 is undefined. It is an error to
specify both -mtrap-large-shift and -mhandle-
large-shift.
-mno-trap-large-shift
Do not emit a tbnd instruction before each shift
by a non-constant amount, to trap if the shift
count is less than zero or greater than 31.
-mhandle-large-shift
Emit a four instruction sequence for each shift by
a non-constant amount, if the shift count is less
than zero or greater than 31. Logical shifts and
arithmetic shifts left produce a 0 result if the
shift count is out of bounds. Arithmetic shifts
right produce a copy of the sign bit if the shift
count is out of bounds. The ANSI standard for C
specifies that shifts outside of the range of 0 to
number_bits - 1 is undefined. It is an error to
specify both -mtrap-large-shift and -mhandle-
large-shift.
-mno-handle-large-shift
Emit a single instruction to handle all shifts
(unless -mtrap-large-shift is specified).
-mcheck-zero-division
Emit code to check if an integer division by zero
occurs and issue trap number 503 if it occurs.
The current 88000 processors do not reliably check
the dividend for zero. This is the default
behavior of the GNU C compiler.
-mno-check-zero-division
Do not emit code to check both the divisor and
dividend when doing normal integer division (as
opposed to unsigned division) to see if either is
negative, and fixup things up so that the division
is done with positive numbers. You would use this
switch when you are confident that most or all
Licensed material--property of copyright holder(s) Page 9
gcc(1) DG/UX 4.30 gcc(1)
signed divisions are done with positive numbers.
-muse-div-instruction
Do not emit code to check if an integer division
by zero occurs and issue trap number 503 if it
occurs.
If this fixup is not done, the 88100 will trap to
the kernel if either number is negative. The
operating system will calculate the correct answer
for all negative operands, except for the most
negative number (-214783648) divided by negative
1, whose signed result cannot be represented in 32
bits.
-mno-use-div-instruction
Emit code to check both the divisior and dividend
when doing normal integer division (as opposed to
unsigned division) to see if either is negative,
and fixup things up so that the division is done
with positive numbers (except for the case of the
most negative number which does not have a
positive counterpart). This is the default
behavior of the GNU C compiler.
The cost of doing this check is that up to two
more registers are needed; some extra time is
spent figuring out whether the operands are
negative; and the GNU compiler does not optimize
expressions containing division like it would
normally.
-mlegend
Produce debugging information for the mxdb
debugger. This option takes effect only in
combination with the -g option. This and the
following two options affect the options passed to
the assembler.
-mexternal-legend
Place mxdb debugging information in an external
file. This option takes effect only in
combination with the -g and -mlegend options.
-mkeep-coff
When producing mxdb debugging information,
generate standard COFF debugging information as
well; the object produced can be debugged using
mxdb, dbx, or sdb. This option takes effect only
in combination with the -g and -mlegend options.
-fflag
Licensed material--property of copyright holder(s) Page 10
gcc(1) DG/UX 4.30 gcc(1)
Specify machine-independent flags. Most flags have
both positive and negative forms; the negative form of
-ffoo would be -fno-foo. In the table below, only one
of the forms is listed--the one which is not the
default. You can figure out the other form by either
removing no- or adding it.
-ffloat-store
Do not store floating-point variables in
registers.
-fno-asm
Do not recognize asm, inline or typeof as a
keyword. These words may then be used as
identifiers.
-fno-defer-pop
Always pop the arguments to each function call as
soon as that function returns. Normally the
compiler (when optimizing) lets arguments
accumulate on the stack for several function calls
and pops them all at once.
-fstrength-reduce
Perform the optimizations of loop strength
reduction and elimination of iteration variables.
-fcombine-regs
Allow the combine pass to combine an instruction
that copies one register into another. This might
or might not produce better code when used in
addition to -O.
-fforce-mem
Force memory operands to be copied into registers
before doing arithmetic on them. This may produce
better code by making all memory references
potential common subexpressions. When they are
not common subexpressions, instruction combination
should eliminate the separate register-load.
-fforce-addr
Force memory address constants to be copied into
registers before doing arithmetic on them. This
may produce better code just as -fforce-mem may.
-fomit-frame-pointer
Don't keep the frame pointer in a register for
functions that don't need one. This eliminates
the instructions that save, set up and restore
frame pointers; it also makes an extra register
available in many functions. It also makes
Licensed material--property of copyright holder(s) Page 11
gcc(1) DG/UX 4.30 gcc(1)
debugging impossible.
* On the AViiON, if you specify -O and do not
specify -g or -fno-omit-frame-pointer, this is
enabled automatically. Specifying -O with -g
causes the default -fno-omit-frame-pointer is
taken.
-finline-functions
Integrate all simple functions into their callers.
The compiler heuristically decides which functions
are simple enough to be worth integrating in this
way. If all calls to a given function are
integrated, and the function is declared static,
then the function is normally not output as
assembler code in its own right.
-fkeep-inline-functions
Even if all calls to a given function are
integrated, and the function is declared static,
nevertheless output a separate run-time callable
version of the function.
-fwritable-strings
Store string constants in the writable data
segment and represent identical strings distinctly
(don't share storage). This is for compatibility
with old programs which assume they can write into
string constants.
-fcond-mismatch
Allow conditional expressions with mismatched
types in the second and third arguments. The
value of such an expression is void.
-fno-function-cse
Do not put function addresses in registers; make
each instruction that calls a constant function
contain the function's address explicitly. This
option results in less efficient code, but some
strange hacks that alter the assembler output may
be confused by the optimizations performed when
this option is not used.
-fvolatile
Consider all memory references through pointers to
be volatile.
-fvolatile-global
Consider all memory references to extern and
global data items to be volatile.
Licensed material--property of copyright holder(s) Page 12
gcc(1) DG/UX 4.30 gcc(1)
-funsigned-char
Let the type char be unsigned, like unsigned char.
The type char is always a distinct type from
either signed char or unsigned char, even though
its behavior is always just like one of those two.
Note that this is equivalent to -fno-signed-char,
which is the negative form of -fsigned-char.
-fsigned-char
Let the type char be the same as signed char.
Note that this is equivalent to -fno-unsigned-
char, which is the negative form of -funsigned-
char.
-funsigned-bit
Treat bitfields that do not specify unsigned or
signed as if unsigned were specified. Note that
this is equivalent to -fno-signed-bit, which is
the negative form of -fsigned-bit.
-fsigned-bit
Treat bitfields that do not specify unsigned or
signed as if signed were specified. Note that
this is equivalent to -fno-unsigned-bit, which is
the negative form of -funsigned-bit.
-ffixed-reg
Treat the register named reg as a fixed register;
generated code should never refer to it (except
perhaps as a stack pointer, frame pointer or in
some other fixed role). reg is one of r0-r31.
Use of this flag for a register that has a fixed
pervasive role in the machine's execution model,
such as the stack pointer or frame pointer, will
produce disastrous results. This flag does not
have a negative form, because it specifies a
three-way choice.
-fcall-used-reg
Treat the register named reg as an allocatable
register that is clobbered by function calls. It
may be allocated for temporaries or variables that
do not live across a call. Functions compiled
this way will not save and restore the register
reg. Use of this flag for a register that has a
fixed pervasive role in the machine's execution
model, such as the stack pointer or frame pointer,
will produce disastrous results. This flag does
not have a negative form, because it specifies a
three-way choice.
-fcall-saved-reg
Licensed material--property of copyright holder(s) Page 13
gcc(1) DG/UX 4.30 gcc(1)
Treat the register named reg as an allocatable
register saved by functions. It may be allocated
even for temporaries or variables that live across
a call. Functions compiled this way will save and
restore the register reg if they use it. Use of
this flag for a register that has a fixed
pervasive role in the machine's execution model,
such as the stack pointer or frame pointer, will
produce disastrous results. A different sort of
disaster will result from the use of this flag for
a register in which function values may be
returned. This flag does not have a negative
form, because it specifies a three-way choice.
-dletters
Make debugging dumps at times specified by letters.
Here are the possible letters:
r Dump after RTL generation.
j Dump after first jump optimization.
J Dump after last jump optimization.
s Dump after CSE (including the jump optimization
that sometimes follows CSE).
L Dump after loop optimization.
f Dump after flow analysis.
c Dump after instruction combination.
l Dump after local register allocation.
g Dump after global register allocation.
m Print statistics on memory usage, at the end of
the run.
-pedantic
Issue all the warnings demanded by strict ANSI standard
C; reject all programs that use forbidden extensions.
Valid ANSI standard C programs should compile properly
with or without this option (though a rare few will
require -ansi). However, without this option, certain
GNU extensions and traditional C features are supported
as well. With this option, they are rejected.
There are several macros you can define to control your
source and target environments when developing applications.
These macros control header files, function declarations,
Licensed material--property of copyright holder(s) Page 14
gcc(1) DG/UX 4.30 gcc(1)
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 input file
file.o object file
a.out loaded output
TMPDIR/cc* temporary files. TMPDIR is usually
/usr/tmp but can be redefined by
setting the environment variable
TMPDIR.
/usr/lib/gcc/gcc-cpp preprocessor
/usr/lib/gcc/gcc-cc1 compiler
/usr/lib/gcc/gcc-gnulib library needed by gcc
/lib/crt0.o runtime startup routine
/lib/libc.a standard library, see intro(3)
/usr/include standard directory for #include
files
SEE ALSO
cc(1), as(1), ld(1), sde-target(1), sdetab(4), sde(5).
COPYING
Copyright (c) 1988 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies
of the gcc(1) manual page provided the copyright notice and
this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified
versions of the gcc(1) manual page under the conditions for
verbatim copying, provided that the entire resulting derived
work is distributed under the terms of a permission notice
identical to this one.
Permission is granted to copy and distribute translations of
the gcc(1) manual page into another language, under the
above conditions for modified versions, except that this
permission notice may be included in translations approved
by the Free Software Foundation instead of in the original
English.
Licensed material--property of copyright holder(s) Page 15