OSDN Git Service

* g++.old-deja/g++.other/eh4.C: Fix typo.
[pf3gnuchains/gcc-fork.git] / gcc / gcc.texi
index c319731..f83ded7 100644 (file)
 @c
 @c anything else?                       --mew 10feb93
 
-
+@macro gcctabopt{body}
+@code{\body\}
+@end macro
+@macro gccoptlist{body}
+@smallexample
+\body\
+@end smallexample
+@end macro
+@c Makeinfo handles the above macro OK, TeX needs manual line breaks;
+@c they get lost at some point in handling the macro.  But if @macro is
+@c used here rather than @alias, it produces double line breaks.
+@iftex
+@alias gol = *
+@end iftex
+@ifnottex
+@macro gol
+@end macro
+@end ifnottex
 
 @ifset INTERNALS
 @ifset USING
@@ -100,7 +117,10 @@ Published by the Free Software Foundation@*
 59 Temple Place - Suite 330@*
 Boston, MA 02111-1307 USA
 @sp 1
-Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+@c When you update the list of years below, search for copyright{} and
+@c update the other copy too.
+Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001 Free Software Foundation, Inc.
 @sp 1
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -146,16 +166,17 @@ instead of in the original English.
 @sp 2
 @center Richard M. Stallman
 @sp 3
-@center Last updated 10 November 2000
+@center Last updated 22 March 2001
 @sp 1
 @c The version number appears five times more in this file.
 
-@center for gcc-2.97
+@center for gcc-3.1
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000  Free Software Foundation, Inc.
+Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998,
+1999, 2000, 2001  Free Software Foundation, Inc.
 @sp 2
-For GCC Version 2.97@*
+For GCC Version 3.1@*
 @sp 1
 Published by the Free Software Foundation @*
 59 Temple Place - Suite 330@*
@@ -192,19 +213,19 @@ instead of in the original English.
 @ifset USING
 This manual documents how to run, install and port the GNU
 compiler, as well as its new features and incompatibilities, and how to
-report bugs.  It corresponds to GCC version 2.97.
+report bugs.  It corresponds to GCC version 3.1.
 @end ifset
 @end ifset
 
 @ifclear INTERNALS
 This manual documents how to run and install the GNU compiler,
 as well as its new features and incompatibilities, and how to report
-bugs.  It corresponds to GCC version 2.97.
+bugs.  It corresponds to GCC version 3.1.
 @end ifclear
 @ifclear USING
 This manual documents how to port the GNU compiler,
 as well as its new features and incompatibilities, and how to report
-bugs.  It corresponds to GCC version 2.97.
+bugs.  It corresponds to GCC version 3.1.
 @end ifclear
 
 @menu
@@ -221,6 +242,7 @@ bugs.  It corresponds to GCC version 2.97.
 * Service::         How to find suppliers of support for GCC.
 * Contributing::    How to contribute to testing and developing GCC.
 * VMS::             Using GCC on VMS.
+* Makefile::        List of Makefile targets.
 @end ifset
 @ifset INTERNALS
 * Portability::     Goals of GCC's portability features.
@@ -251,8 +273,8 @@ bugs.  It corresponds to GCC version 2.97.
 Several versions of the compiler (C, C++, Objective C, Fortran, Java
 and CHILL) are integrated; this is why we use the name 
 ``GNU Compiler Collection''. GCC can compile programs written in any of these
-languages. The Fortran and CHILL compilers are described in 
-separate manuals. The Java compiler currently has no manual documenting it.
+languages. The Fortran, CHILL, and Java compilers are described in 
+separate manuals.
 
 @cindex GCC
 ``GCC'' is a common shorthand term for the GNU Compiler Collection.  This is both
@@ -449,6 +471,9 @@ information concerning the history of C that is available online, see
 @xref{Language,,The GNU Fortran Language, g77, Using and Porting GNU
 Fortran}, for details of the Fortran language supported by GCC.
 
+@xref{Compatibility,,Compatibility with the Java Platform, gcj, GNU gcj},
+for details of compatibility between @code{gcj} and the Java Platform.
+
 @xref{References,,Language Definition References, chill, GNU Chill},
 for details of the CHILL standard.
 
@@ -512,18 +537,9 @@ edit the offending file and place the typedef in front of the
 prototypes.
 
 @item
-There are several obscure case of mis-using struct, union, and
-enum tags that are not detected as errors by the compiler.
-
-@item
 When @samp{-pedantic-errors} is specified, GCC will incorrectly give
 an error message when a function name is specified in an expression
 involving the comma operator.
-
-@item
-Loop unrolling doesn't work properly for certain C++ programs.  This is
-a bug in the C++ front end.  It sometimes emits incorrect debug info, and
-the loop unrolling code is unable to recover from this error.
 @end itemize
 
 @node Installation Problems
@@ -556,17 +572,6 @@ that type mismatches occur, this could be the cause.
 The solution is not to use such a directory for building GCC.
 
 @item
-In previous versions of GCC, the @code{gcc} driver program looked for
-@code{as} and @code{ld} in various places; for example, in files
-beginning with @file{/usr/local/lib/gcc-}.  GCC version 2 looks for
-them in the directory
-@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}.
-
-Thus, to use a version of @code{as} or @code{ld} that is not the system
-default, for example @code{gas} or GNU @code{ld}, you must put them in
-that directory (or make links to them from that directory).
-
-@item
 Some commands executed when making the compiler may fail (return a
 non-zero status) and be ignored by @code{make}.  These failures, which
 are often due to files that were not found, are expected, and can safely
@@ -584,12 +589,6 @@ the compiler.  In one case, this was traced down to a bug in
 @code{make}.  Either ignore the problem or switch to GNU Make.
 
 @item
-If you have installed a program known as purify, you may find that it
-causes errors while linking @code{enquire}, which is part of building
-GCC.  The fix is to get rid of the file @code{real-ld} which purify
-installs---so that GCC won't try to use it.
-
-@item
 On GNU/Linux SLS 1.01, there is a problem with @file{libc.a}: it does not
 contain the obstack functions.  However, GCC assumes that the obstack
 functions are in @file{libc.a} when it is the GNU C library.  To work
@@ -597,52 +596,6 @@ around this problem, change the @code{__GNU_LIBRARY__} conditional
 around line 31 to @samp{#if 1}.
 
 @item
-On some 386 systems, building the compiler never finishes because
-@code{enquire} hangs due to a hardware problem in the motherboard---it
-reports floating point exceptions to the kernel incorrectly.  You can
-install GCC except for @file{float.h} by patching out the command to
-run @code{enquire}.  You may also be able to fix the problem for real by
-getting a replacement motherboard.  This problem was observed in
-Revision E of the Micronics motherboard, and is fixed in Revision F.
-It has also been observed in the MYLEX MXA-33 motherboard.
-
-If you encounter this problem, you may also want to consider removing
-the FPU from the socket during the compilation.  Alternatively, if you
-are running SCO Unix, you can reboot and force the FPU to be ignored.
-To do this, type @samp{hd(40)unix auto ignorefpu}.
-
-@item
-On some 386 systems, GCC crashes trying to compile @file{enquire.c}.
-This happens on machines that don't have a 387 FPU chip.  On 386
-machines, the system kernel is supposed to emulate the 387 when you
-don't have one.  The crash is due to a bug in the emulator.
-
-One of these systems is the Unix from Interactive Systems: 386/ix.
-On this system, an alternate emulator is provided, and it does work.
-To use it, execute this command as super-user:
-
-@example
-ln /etc/emulator.rel1 /etc/emulator
-@end example
-
-@noindent
-and then reboot the system.  (The default emulator file remains present
-under the name @file{emulator.dflt}.)
-
-Try using @file{/etc/emulator.att}, if you have such a problem on the
-SCO system.
-
-Another system which has this problem is Esix.  We don't know whether it
-has an alternate emulator that works.
-
-On NetBSD 0.8, a similar problem manifests itself as these error messages:
-
-@example
-enquire.c: In function `fprop':
-enquire.c:2328: floating overflow
-@end example
-
-@item
 On SCO systems, when compiling GCC with the system's compiler,
 do not use @samp{-O}.  Some versions of the system's compiler miscompile
 GCC with @samp{-O}.
@@ -706,25 +659,6 @@ It would be nice to extend GAS to produce the gp tables, but they are
 optional, and there should not be a warning about their absence.
 
 @item
-In Ultrix 4.0 on the MIPS machine, @file{stdio.h} does not work with GNU
-CC at all unless it has been fixed with @code{fixincludes}.  This causes
-problems in building GCC.  Once GCC is installed, the problems go
-away.
-
-To work around this problem, when making the stage 1 compiler, specify
-this option to Make:
-
-@example
-GCC_FOR_TARGET="./xgcc -B./ -I./include"
-@end example
-
-When making stage 2 and stage 3, specify this option:
-
-@example
-CFLAGS="-g -I./include"
-@end example
-
-@item
 Users have reported some problems with version 2.0 of the MIPS
 compiler tools that were shipped with Ultrix 4.1.  Version 2.10
 which came with Ultrix 4.2 seems to work fine.
@@ -828,16 +762,6 @@ If you encounter this problem, upgrade your operating system or
 use BASH (the GNU shell) to run @code{fixproto}.
 
 @item
-Some versions of the Pyramid C compiler are reported to be unable to
-compile GCC.  You must use an older version of GCC for
-bootstrapping.  One indication of this problem is if you get a crash
-when GCC compiles the function @code{muldi3} in file @file{libgcc2.c}.
-
-You may be able to succeed by getting GCC version 1, installing it,
-and using it to compile GCC version 2.  The bug in the Pyramid C
-compiler does not seem to affect GCC version 1.
-
-@item
 There may be similar problems on System V Release 3.1 on 386 systems.
 
 @item
@@ -1608,8 +1532,10 @@ requires that this be treated as erroneous.
 
 A @dfn{preprocessing token} is a @dfn{preprocessing number} if it
 begins with a digit and is followed by letters, underscores, digits,
-periods and @samp{e+}, @samp{e-}, @samp{E+}, or @samp{E-} character
-sequences.
+periods and @samp{e+}, @samp{e-}, @samp{E+}, @samp{E-}, @samp{p+},
+@samp{p-}, @samp{P+}, or @samp{P-} character sequences.  (In strict C89
+mode, the sequences @samp{p+}, @samp{p-}, @samp{P+} and @samp{P-} cannot
+appear in preprocessing numbers.)
 
 To make the above program fragment valid, place whitespace in front of
 the minus sign.  This whitespace will end the preprocessing number.
@@ -2186,7 +2112,8 @@ is relevant to the design of plain @samp{gcc} without @samp{-ansi} only
 for pragmatic reasons, not as a requirement.
 
 GCC normally defines @code{__STDC__} to be 1, and in addition
-defines @code{__STRICT_ANSI__} if you specify the @samp{-ansi} option.
+defines @code{__STRICT_ANSI__} if you specify the @option{-ansi} option,
+or a @option{-std} option for strict conformance to some version of ISO C.
 On some hosts, system include files use a different convention, where
 @code{__STDC__} is normally 0, but is 1 if the user specifies strict
 conformance to the C Standard.  GCC follows the host convention when
@@ -2426,32 +2353,13 @@ convention, in which bug reports for tool ``foo'' are sent
 to @samp{bug-foo@@gnu.org}, the address @email{bug-gcc@@gnu.org}
 may also be used; it will forward to the address given above.
 
-Please read @uref{http://www.gnu.org/software/gcc/bugs.html} for
-bug reporting instructions before you post a bug report.
-
-Often people think of posting bug reports to the newsgroup instead of
-mailing them.  This appears to work, but it has one problem which can be
-crucial: a newsgroup posting does not contain a mail path back to the
-sender.  Thus, if maintainers need more information, they may be unable
-to reach you.  For this reason, you should always send bug reports by
-mail to the proper mailing list.
-
-As a last resort, send bug reports on paper to:
-
-@example
-GNU Compiler Bugs
-Free Software Foundation
-59 Temple Place - Suite 330
-Boston, MA 02111-1307, USA
-@end example
+Please read @uref{http://gcc.gnu.org/bugs.html} for additional and/or
+more up-to-date bug reporting instructions before you post a bug report.
 
 @node Bug Reporting,gccbug,Bug Lists,Bugs
 @section How to Report Bugs
 @cindex compiler bugs, reporting
 
-You may find additional and/or more up-to-date instructions at
-@uref{http://www.gnu.org/software/gcc/bugs.html}.
-
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
 fact or leave it out, state it!
@@ -2965,7 +2873,7 @@ Send a message to a suitable network mailing list.  First try
 that brings no response, try @email{gcc@@gcc.gnu.org}.  For help
 changing GCC, ask @email{gcc@@gcc.gnu.org}.  If you think you have found
 a bug in GCC, please report it following the instructions at
-@uref{http://gcc.gnu.org/bugs.html}.
+@pxref{Bug Reporting}.
 
 @item
 Look in the service directory for someone who might help you for a fee.
@@ -2985,11 +2893,6 @@ If you would like to help pretest GCC releases to assure they work well,
 our current development sources are available by CVS (see
 @uref{http://gcc.gnu.org/cvs.html}).  Source and binary snapshots are
 also available for FTP; see @uref{http://gcc.gnu.org/snapshots.html}.
-Remember that snapshots of the current development sources may not be of
-production quality; if you find problems (whether compiler crashes,
-miscompiled code, poor optimization or any other problem), please report
-them following our bug reporting instructions at
-@uref{http://gcc.gnu.org/bugs.html}.
 
 If you would like to work on improvements to GCC, please read
 @uref{http://gcc.gnu.org/contribute.html} and
@@ -3323,6 +3226,105 @@ itself.  For example:
 
 These macro definitions can be placed in a header file to minimize the
 number of changes to your source code.
+
+@node Makefile
+@chapter Makefile Targets
+@cindex makefile targets
+@cindex targets, makefile
+
+@table @code
+@item all
+This is the default target.  Depending on what your build/host/target
+configuration is, it coordinates all the things that need to be built.
+
+@item doc
+Produce info-formatted documentation.  Also, @code{make dvi} is
+available for DVI-formatted documentation, and @code{make
+generated-manpages} to generate man pages.
+
+@item mostlyclean
+Delete the files made while building the compiler.
+
+@item clean
+That, and all the other files built by @code{make all}.
+
+@item distclean
+That, and all the files created by @code{configure}.
+
+@item extraclean
+That, and any temporary or intermediate files, like emacs backup files.
+
+@item maintainer-clean
+Distclean plus any file that can be generated from other files.  Note
+that additional tools may be required beyond what is normally needed to
+build gcc.
+
+@item install
+Installs gcc.
+
+@item uninstall
+Deletes installed files.
+
+@item check
+Run the testsuite.  This creates a @file{testsuite} subdirectory that
+has various @file{.sum} and @file{.log} files containing the results of
+the testing.  You can run subsets with, for example, @code{make check-gcc}.
+You can specify specific tests by setting RUNTESTFLAGS to be the name
+of the @file{.exp} file, optionally followed by (for some tests) an equals
+and a file wildcard, like:
+
+@example
+make check-gcc RUNTESTFLAGS="execute.exp=19980413-*"
+@end example
+
+Note that running the testsuite may require additional tools be
+installed, such as TCL or dejagnu.
+
+@item bootstrap
+Builds gcc three times - once with the native compiler, once with the
+native-built compiler it just built, and once with the compiler it built
+the second time.  In theory, the last two should produce the same
+results, which @code{make compare} can check.  Each step of this process
+is called a "stage", and the results of each stage N (N=1..3) are copied
+to a subdirectory @file{stageN/}.
+
+@item bootstrap-lean
+Like @code{bootstrap}, except that the various stages are removed once
+they're no longer needed.  This saves disk space.
+
+@item bubblestrap
+Once bootstrapped, this incrementally rebuilds each of the three stages,
+one at a time.  It does this by "bubbling" the stages up from their
+stubdirectories, rebuilding them, and copying them back to their
+subdirectories.  This will allow you to, for example, quickly rebuild a
+bootstrapped compiler after changing the sources, without having to do a
+full bootstrap.
+
+@item quickstrap
+Rebuilds the most recently built stage.  Since each stage requires
+special invocation, using this target means you don't have to keep track
+of which stage you're on or what invocation that stage needs.
+
+@item cleanstrap
+Removed everything (@code{make clean}) and rebuilds (@code{make bootstrap}).
+
+@item stageN (N=1..4)
+For each stage, moves the appropriate files to the stageN subdirectory.
+
+@item unstageN (N=1..4)
+Undoes the corresponding @code{stageN}.
+
+@item restageN (N=1..4)
+Undoes the corresponding @code{stageN} and rebuilds it with the
+appropriate flags.
+
+@item compare
+Compares the results of stages 2 and 3.  This ensures that the compiler
+is running properly, since it should produce the same object files
+regardless of how it itself was compiled.
+
+@end table
+
 @end ifset
 
 @ifset INTERNALS
@@ -3986,12 +3988,17 @@ Define this macro if the host system is VMS.
 @findex FATAL_EXIT_CODE
 @item FATAL_EXIT_CODE
 A C expression for the status code to be returned when the compiler
-exits after serious errors.
+exits after serious errors.  The default is the system-provided macro
+@samp{EXIT_FAILURE}, or @samp{1} if the system doesn't define that
+macro.  Define this macro only if these defaults are incorrect.
 
 @findex SUCCESS_EXIT_CODE
 @item SUCCESS_EXIT_CODE
 A C expression for the status code to be returned when the compiler
-exits without serious errors.
+exits without serious errors.  (Warnings are not serious errors.)  The
+default is the system-provided macro @samp{EXIT_SUCCESS}, or @samp{0} if
+the system doesn't define that macro.  Define this macro only if these
+defaults are incorrect.
 
 @findex HOST_WORDS_BIG_ENDIAN
 @item HOST_WORDS_BIG_ENDIAN
@@ -4095,15 +4102,6 @@ characters.
 @item POSIX
 Define this if your system is POSIX.1 compliant.
 
-@findex USE_PROTOTYPES
-@item USE_PROTOTYPES
-Define this to be 1 if you know that the host compiler supports
-prototypes, even if it doesn't define __STDC__, or define
-it to be 0 if you do not want any prototypes used in compiling
-GCC.  If @samp{USE_PROTOTYPES} is not defined, it will be
-determined automatically whether your compiler supports
-prototypes by checking if @samp{__STDC__} is defined.
-
 @findex PATH_SEPARATOR
 @item PATH_SEPARATOR
 Define this macro to be a C character constant representing the
@@ -4130,6 +4128,12 @@ Define this macro to be a C string representing the suffix for executable
 files on your machine.  If you do not define this macro, GCC will use
 the null string as the suffix for object files.
 
+@findex NO_AUTO_EXE_SUFFIX
+@item NO_AUTO_EXE_SUFFIX
+Define this macro if executable files on your machine have a suffix, but 
+the compiler driver should not automatically append it to the output file
+name, if user hasn't specified one.
+
 @findex HOST_BIT_BUCKET
 @item HOST_BIT_BUCKET
 The name of a file or file-like object on the host system which acts as