Using the GNU Compiler Collection
For gcc version 4.6.4
(GCC)
Richard M. Stallman and the GCC Developer Community
Published by:
GNU Press Website: www.gnupress.org
a division of the General: press@gnu.org
Free Software Foundation Orders: sales@gnu.org
51 Franklin Street, Fifth Floor Tel 617-542-5942
Boston, MA 02110-1301 USA Fax 617-542-2652
Last printed October 2003 for GCC 3.3.1.
Printed copies are available for $45 each.
Copyright
c
1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of
the GNU Free Documentation License, Version 1.3 or any later version published by the
Free Software Foundation; with the Invariant Sections being “Funding Free Software”, the
Front-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (see
below). A copy of the license is included in the section entitled “GNU Free Documentation
License”.
(a) The FSF’s Front-Cover Text is:
A GNU Manual
(b) The FSF’s Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU software. Copies
published by the Free Software Foundation raise funds for GNU development.
i
Short Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 Programming Languages Supported by GCC . . . . . . . . . . . . . . . 3
2 Language Standards Supported by GCC . . . . . . . . . . . . . . . . . . 5
3 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 C Implementation-defined behavior . . . . . . . . . . . . . . . . . . . . . 281
5 C++ Implementation-defined behavior . . . . . . . . . . . . . . . . . . 289
6 Extensions to the C Language Family . . . . . . . . . . . . . . . . . . . 291
7 Extensions to the C++ Language . . . . . . . . . . . . . . . . . . . . . . 583
8 GNU Objective-C features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
9 Binary Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
10 gcov—a Test Coverage Program . . . . . . . . . . . . . . . . . . . . . . . 615
11 Known Causes of Trouble with GCC . . . . . . . . . . . . . . . . . . . . 623
12 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
13 How To Get Help with GCC . . . . . . . . . . . . . . . . . . . . . . . . . . 641
14 Contributing to GCC Development . . . . . . . . . . . . . . . . . . . . . 643
Funding Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
The GNU Project and GNU/Linux. . . . . . . . . . . . . . . . . . . . . . . . . 647
GNU General Public License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . 661
Contributors to GCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Option Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
Keyword Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
iii
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 Programming Languages Supported by GCC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Language Standards Supported by GCC . . . . . 5
2.1 C language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 C++ language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Objective-C and Objective-C++ languages . . . . . . . . . . . . . . . . . . . . . 7
2.4 Go language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 References for other languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . . 9
3.1 Option Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Options Controlling the Kind of Output . . . . . . . . . . . . . . . . . . . . . . . 23
3.3 Compiling C++ Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.4 Options Controlling C Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.5 Options Controlling C++ Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.6 Options Controlling Objective-C and Objective-C++ Dialects . . 43
3.7 Options to Control Diagnostic Messages Formatting . . . . . . . . . . . 47
3.8 Options to Request or Suppress Warnings . . . . . . . . . . . . . . . . . . . . . 47
3.9 Options for Debugging Your Program or GCC . . . . . . . . . . . . . . . . . 70
3.10 Options That Control Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.11 Options Controlling the Preprocessor. . . . . . . . . . . . . . . . . . . . . . . . 137
3.12 Passing Options to the Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.13 Options for Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.14 Options for Directory Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
3.15 Specifying subprocesses and the switches to pass to them . . . . 153
3.16 Specifying Target Machine and Compiler Version . . . . . . . . . . . . 161
3.17 Hardware Models and Configurations . . . . . . . . . . . . . . . . . . . . . . . 161
3.17.1 ARC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.17.2 ARM Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.17.3 AVR Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
3.17.3.1 EIND and Devices with more than 128k Bytes of Flash
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
3.17.4 Blackfin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
3.17.5 CRIS Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
3.17.6 CRX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
3.17.7 Darwin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
3.17.8 DEC Alpha Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
3.17.9 DEC Alpha/VMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
3.17.10 FR30 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
评论0