“Option Summary” in Using the GNU Compiler Collection (GCC)
Total Page:16
File Type:pdf, Size:1020Kb
Using the GNU Compiler Collection For gcc version 4.3.6 (GCC) Richard M. Stallman and the GCC Developer Community Published by: GNU Press Website: www.gnupress.org a division of the General: [email protected] Free Software Foundation Orders: [email protected] 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 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.2 or any later version published by the Free Software Foundation; with the Invariant Sections being “GNU General Public License” and “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 ..................... 237 5 Extensions to the C Language Family ................... 245 6 Extensions to the C++ Language ...................... 503 7 GNU Objective-C runtime features ..................... 515 8 Binary Compatibility ................................ 521 9 gcov—a Test Coverage Program ....................... 525 10 Known Causes of Trouble with GCC .................... 533 11 Reporting Bugs ..................................... 551 12 How To Get Help with GCC .......................... 553 13 Contributing to GCC Development ..................... 555 Funding Free Software ................................... 557 The GNU Project and GNU/Linux......................... 559 GNU General Public License .............................. 561 GNU Free Documentation License ......................... 573 Contributors to GCC .................................... 581 Option Index .......................................... 597 Keyword Index ......................................... 613 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 Treelang language .............................................. 7 3 GCC Command Options ....................... 9 3.1 Option Summary............................................... 9 3.2 Options Controlling the Kind of Output ....................... 20 3.3 Compiling C++ Programs .................................... 25 3.4 Options Controlling C Dialect ................................. 26 3.5 Options Controlling C++ Dialect ............................. 31 3.6 Options Controlling Objective-C and Objective-C++ Dialects .. 38 3.7 Options to Control Diagnostic Messages Formatting ........... 42 3.8 Options to Request or Suppress Warnings ..................... 43 3.9 Options for Debugging Your Program or GCC ................. 63 3.10 Options That Control Optimization .......................... 77 3.11 Options Controlling the Preprocessor........................ 113 3.12 Passing Options to the Assembler ........................... 123 3.13 Options for Linking ......................................... 123 3.14 Options for Directory Search ................................ 126 3.15 Specifying subprocesses and the switches to pass to them .... 128 3.16 Specifying Target Machine and Compiler Version ............ 135 3.17 Hardware Models and Configurations ....................... 135 3.17.1 ARC Options .......................................... 135 3.17.2 ARM Options.......................................... 136 3.17.3 AVR Options .......................................... 140 3.17.4 Blackfin Options ....................................... 141 3.17.5 CRIS Options.......................................... 143 3.17.6 CRX Options .......................................... 145 3.17.7 Darwin Options ........................................ 145 3.17.8 DEC Alpha Options ................................... 149 3.17.9 DEC Alpha/VMS Options ............................. 153 3.17.10 FRV Options ......................................... 153 3.17.11 GNU/Linux Options .................................. 157 3.17.12 H8/300 Options....................................... 157 3.17.13 HPPA Options........................................ 158 iv Using the GNU Compiler Collection (GCC) 3.17.14 Intel 386 and AMD x86-64 Options ................... 161 3.17.15 IA-64 Options ........................................ 171 3.17.16 M32C Options ........................................ 174 3.17.17 M32R/D Options ..................................... 174 3.17.18 M680x0 Options ...................................... 176 3.17.19 M68hc1x Options ..................................... 181 3.17.20 MCore Options ....................................... 181 3.17.21 MIPS Options ........................................ 182 3.17.22 MMIX Options ....................................... 191 3.17.23 MN10300 Options .................................... 192 3.17.24 MT Options .......................................... 193 3.17.25 PDP-11 Options ...................................... 193 3.17.26 PowerPC Options..................................... 194 3.17.27 IBM RS/6000 and PowerPC Options .................. 194 3.17.28 S/390 and zSeries Options ............................ 206 3.17.29 Score Options......................................... 209 3.17.30 SH Options ........................................... 209 3.17.31 SPARC Options ...................................... 213 3.17.32 SPU Options ......................................... 217 3.17.33 Options for System V ................................. 218 3.17.34 V850 Options ......................................... 218 3.17.35 VAX Options ......................................... 219 3.17.36 VxWorks Options ..................................... 220 3.17.37 x86-64 Options ....................................... 220 3.17.38 Xstormy16 Options ................................... 220 3.17.39 Xtensa Options ....................................... 220 3.17.40 zSeries Options ....................................... 221 3.18 Options for Code Generation Conventions ................... 222 3.19 Environment Variables Affecting GCC ...................... 229 3.20 Using Precompiled Headers ................................. 232 3.21 Running Protoize ........................................... 234 4 C Implementation-defined behavior ........ 237 4.1 Translation .................................................. 237 4.2 Environment................................................. 237 4.3 Identifiers.................................................... 237 4.4 Characters ................................................... 238 4.5 Integers...................................................... 238 4.6 Floating point ............................................... 239 4.7 Arrays and pointers .......................................... 240 4.8 Hints ........................................................ 241 4.9 Structures, unions, enumerations, and bit-fields ............... 241 4.10 Qualifiers ................................................... 242 4.11 Declarators ................................................. 242 4.12 Statements ................................................. 242 4.13 Preprocessing directives ..................................... 242 4.14 Library functions ........................................... 243 4.15 Architecture ................................................ 243 v 4.16 Locale-specific behavior ..................................... 243 5 Extensions to the C Language Family ...... 245 5.1 Statements and Declarations in Expressions .................. 245 5.2 Locally Declared Labels ...................................... 246 5.3 Labels as Values ............................................. 247 5.4 Nested Functions ............................................ 248 5.5 Constructing Function Calls.................................. 250 5.6 Referring to a Type with typeof ............................. 252 5.7 Conditionals with Omitted Operands......................... 253 5.8 Double-Word Integers ........................................ 254 5.9 Complex Numbers ........................................... 254 5.10 Additional Floating Types .................................. 255 5.11 Decimal Floating Types..................................... 255 5.12 Hex Floats.................................................. 255 5.13 Fixed-Point Types .......................................... 256 5.14 Arrays of Length Zero ...................................... 257 5.15 Structures With No Members ............................... 258 5.16 Arrays of Variable Length..................................