home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 6
/
FreshFish_September1994.bin
/
gnu
/
info
/
gcc.info-2
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-09-02
|
48KB
|
911 lines
This is Info file gcc.info, produced by Makeinfo-1.54 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Published by the Free Software Foundation 675 Massachusetts Avenue
Cambridge, MA 02139 USA
Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License" and "Protect
Your Freedom--Fight `Look And Feel'" are included exactly as in the
original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License" and "Protect Your Freedom--Fight `Look And Feel'", and this
permission notice, may be included in translations approved by the Free
Software Foundation instead of in the original English.
File: gcc.info, Node: Overall Options, Next: Invoking G++, Prev: Option Summary, Up: Invoking GCC
Options Controlling the Kind of Output
======================================
Compilation can involve up to four stages: preprocessing, compilation
proper, assembly and linking, always in that order. The first three
stages apply to an individual source file, and end by producing an
object file; linking combines all the object files (those newly
compiled, and those specified as input) into an executable file.
For any given input file, the file name suffix determines what kind
of compilation is done:
`FILE.c'
C source code which must be preprocessed.
`FILE.i'
C source code which should not be preprocessed.
`FILE.ii'
C++ source code which should not be preprocessed.
`FILE.m'
Objective-C source code. Note that you must link with the library
`libobjc.a' to make an Objective-C program work.
`FILE.h'
C header file (not to be compiled or linked).
`FILE.cc'
`FILE.cxx'
`FILE.cpp'
`FILE.C'
C++ source code which must be preprocessed. Note that in `.cxx',
the last two letters must both be literally `x'. Likewise, `.C'
refers to a literal capital C.
`FILE.s'
Assembler code.
`FILE.S'
Assembler code which must be preprocessed.
`OTHER'
An object file to be fed straight into linking. Any file name
with no recognized suffix is treated this way.
You can specify the input language explicitly with the `-x' option:
`-x LANGUAGE'
Specify explicitly the LANGUAGE for the following input files
(rather than letting the compiler choose a default based on the
file name suffix). This option applies to all following input
files until the next `-x' option. Possible values for LANGUAGE
are:
c objective-c c++
c-header cpp-output c++-cpp-output
assembler assembler-with-cpp
`-x none'
Turn off any specification of a language, so that subsequent files
are handled according to their file name suffixes (as they are if
`-x' has not been used at all).
If you only want some of the stages of compilation, you can use `-x'
(or filename suffixes) to tell `gcc' where to start, and one of the
options `-c', `-S', or `-E' to say where `gcc' is to stop. Note that
some combinations (for example, `-x cpp-output -E' instruct `gcc' to do
nothing at all.
Compile or assemble the source files, but do not link. The linking
stage simply is not done. The ultimate output is in the form of an
object file for each source file.
By default, the object file name for a source file is made by
replacing the suffix `.c', `.i', `.s', etc., with `.o'.
Unrecognized input files, not requiring compilation or assembly,
are ignored.
Stop after the stage of compilation proper; do not assemble. The
output is in the form of an assembler code file for each
non-assembler input file specified.
By default, the assembler file name for a source file is made by
replacing the suffix `.c', `.i', etc., with `.s'.
Input files that don't require compilation are ignored.
Stop after the preprocessing stage; do not run the compiler
proper. The output is in the form of preprocessed source code,
which is sent to the standard output.
Input files which don't require preprocessing are ignored.
`-o FILE'
Place output in file FILE. This applies regardless to whatever
sort of output is being produced, whether it be an executable file,
an object file, an assembler file or preprocessed C code.
Since only one output file can be specified, it does not make
sense to use `-o' when compiling more than one input file, unless
you are producing an executable file as output.
If `-o' is not specified, the default is to put an executable file
in `a.out', the object file for `SOURCE.SUFFIX' in `SOURCE.o', its
assembler file in `SOURCE.s', and all preprocessed C source on
standard output.
Print (on standard error output) the commands executed to run the
stages of compilation. Also print the version number of the
compiler driver program and of the preprocessor and the compiler
proper.
`-pipe'
Use pipes rather than temporary files for communication between the
various stages of compilation. This fails to work on some systems
where the assembler is unable to read from a pipe; but the GNU
assembler has no trouble.
File: gcc.info, Node: Invoking G++, Next: C Dialect Options, Prev: Overall Options, Up: Invoking GCC
Compiling C++ Programs
======================
C++ source files conventionally use one of the suffixes `.C', `.cc',
or `.cxx'; preprocessed C++ files use the suffix `.ii'. GNU CC
recognizes files with these names and compiles them as C++ programs
even if you call the compiler the same way as for compiling C programs
(usually with the name `gcc').
However, C++ programs often require class libraries as well as a
compiler that understands the C++ language--and under some
circumstances, you might want to compile programs from standard input,
or otherwise without a suffix that flags them as C++ programs. `g++'
is a program that calls GNU CC with the default language set to C++,
and automatically specifies linking against the GNU class library
libg++. (1) On many systems, the script `g++' is also installed with
the name `c++'.
When you compile C++ programs, you may specify many of the same
command-line options that you use for compiling programs in any
language; or command-line options meaningful for C and related
languages; or options that are meaningful only for C++ programs. *Note
Options Controlling C Dialect: C Dialect Options, for explanations of
options for languages related to C. *Note Options Controlling C++
Dialect: C++ Dialect Options, for explanations of options that are
meaningful only for C++ programs.
---------- Footnotes ----------
(1) Prior to release 2 of the compiler, there was a separate `g++'
compiler. That version was based on GNU CC, but not integrated with
it. Versions of `g++' with a `1.XX' version number--for example, `g++'
version 1.37 or 1.42--are much less reliable than the versions
integrated with GCC 2. Moreover, combining G++ `1.XX' with a version 2
GCC will simply not work.
File: gcc.info, Node: C Dialect Options, Next: C++ Dialect Options, Prev: Invoking G++, Up: Invoking GCC
Options Controlling C Dialect
=============================
The following options control the dialect of C (or languages derived
from C, such as C++ and Objective C) that the compiler accepts:
`-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 `u