Using the GNU Compiler Collection For gcc version 4.2.4 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 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 ............................... 7 4 C Implementation-defined behavior ..................... 215 5 Extensions to the C Language Family ................... 223 6 Extensions to the C++ Language ...................... 377 7 GNU Objective-C runtime features ..................... 387 8 Binary Compatibility ................................ 393 9 gcov—a Test Coverage Program ....................... 397 10 Known Causes of Trouble with GCC .................... 405 11 Reporting Bugs ..................................... 423 12 How To Get Help with GCC .......................... 425 13 Contributing to GCC Development ..................... 427 Funding Free Software ................................... 429 The GNU Project and GNU/Linux......................... 431 GNU General Public License .............................. 433 GNU Free Documentation License ......................... 445 Contributors to GCC .................................... 453 Option Index .......................................... 469 Keyword Index ......................................... 483 iii Table of Contents Introduction ........................................ 1 1 Programming Languages Supported by GCC ................................................. 3 2 Language Standards Supported by GCC ..... 5 3 GCC Command Options ....................... 7 3.1 Option Summary............................................... 7 3.2 Options Controlling the Kind of Output ....................... 18 3.3 Compiling C++ Programs .................................... 21 3.4 Options Controlling C Dialect ................................. 22 3.5 Options Controlling C++ Dialect ............................. 26 3.6 Options Controlling Objective-C and Objective-C++ Dialects .. 33 3.7 Options to Control Diagnostic Messages Formatting ........... 37 3.8 Options to Request or Suppress Warnings ..................... 38 3.9 Options for Debugging Your Program or GCC ................. 56 3.10 Options That Control Optimization .......................... 69 3.11 Options Controlling the Preprocessor......................... 99 3.12 Passing Options to the Assembler ........................... 109 3.13 Options for Linking ......................................... 109 3.14 Options for Directory Search ................................ 112 3.15 Specifying subprocesses and the switches to pass to them .... 114 3.16 Specifying Target Machine and Compiler Version ............ 121 3.17 Hardware Models and Configurations ....................... 121 3.17.1 ARC Options .......................................... 121 3.17.2 ARM Options.......................................... 122 3.17.3 AVR Options .......................................... 126 3.17.4 Blackfin Options ....................................... 127 3.17.5 CRIS Options.......................................... 128 3.17.6 CRX Options .......................................... 130 3.17.7 Darwin Options ........................................ 130 3.17.8 DEC Alpha Options ................................... 134 3.17.9 DEC Alpha/VMS Options ............................. 138 3.17.10 FRV Options ......................................... 138 3.17.11 GNU/Linux Options .................................. 142 3.17.12 H8/300 Options....................................... 142 3.17.13 HPPA Options........................................ 143 3.17.14 Intel 386 and AMD x86-64 Options ................... 146 3.17.15 IA-64 Options ........................................ 154 3.17.16 M32C Options ........................................ 157 3.17.17 M32R/D Options ..................................... 158 iv Using the GNU Compiler Collection (GCC) 3.17.18 M680x0 Options ...................................... 159 3.17.19 M68hc1x Options ..................................... 162 3.17.20 MCore Options ....................................... 163 3.17.21 MIPS Options ........................................ 163 3.17.22 MMIX Options ....................................... 169 3.17.23 MN10300 Options .................................... 171 3.17.24 MT Options .......................................... 171 3.17.25 PDP-11 Options ...................................... 172 3.17.26 PowerPC Options..................................... 173 3.17.27 IBM RS/6000 and PowerPC Options .................. 173 3.17.28 S/390 and zSeries Options ............................ 184 3.17.29 Score Options......................................... 186 3.17.30 SH Options ........................................... 187 3.17.31 SPARC Options ...................................... 190 3.17.32 Options for System V ................................. 194 3.17.33 TMS320C3x/C4x Options............................. 194 3.17.34 V850 Options ......................................... 196 3.17.35 VAX Options ......................................... 198 3.17.36 x86-64 Options ....................................... 198 3.17.37 Xstormy16 Options ................................... 198 3.17.38 Xtensa Options ....................................... 198 3.17.39 zSeries Options ....................................... 199 3.18 Options for Code Generation Conventions ................... 199 3.19 Environment Variables Affecting GCC ...................... 206 3.20 Using Precompiled Headers ................................. 209 3.21 Running Protoize ........................................... 211 4 C Implementation-defined behavior ........ 215 4.1 Translation .................................................. 215 4.2 Environment................................................. 215 4.3 Identifiers.................................................... 215 4.4 Characters ................................................... 216 4.5 Integers...................................................... 216 4.6 Floating point ............................................... 217 4.7 Arrays and pointers .......................................... 218 4.8 Hints ........................................................ 219 4.9 Structures, unions, enumerations, and bit-fields ............... 219 4.10 Qualifiers ................................................... 220 4.11 Declarators ................................................. 220 4.12 Statements ................................................. 220 4.13 Preprocessing directives ..................................... 220 4.14 Library functions ........................................... 221 4.15 Architecture ................................................ 221 4.16 Locale-specific behavior ..................................... 221 v 5 Extensions to the C Language Family ...... 223 5.1 Statements and Declarations in Expressions .................. 223 5.2 Locally Declared Labels ...................................... 224 5.3 Labels as Values ............................................. 225 5.4 Nested Functions ............................................ 226 5.5 Constructing Function Calls.................................. 228 5.6 Referring to a Type with typeof ............................. 229 5.7 Conditionals with Omitted Operands......................... 230 5.8 Double-Word Integers ........................................ 231 5.9 Complex Numbers ........................................... 231 5.10 Decimal Floating Types..................................... 232 5.11 Hex Floats.................................................. 232 5.12 Arrays of Length Zero ...................................... 232 5.13 Structures With No Members ............................... 234 5.14 Arrays of Variable Length................................... 234 5.15 Macros with a Variable Number of Arguments. .............. 235 5.16 Slightly Looser Rules for Escaped Newlines.................. 236 5.17 Non-Lvalue Arrays May Have Subscripts .................... 236 5.18 Arithmetic on void- and Function-Pointers.................. 236 5.19 Non-Constant Initializers ................................... 236 5.20 Compound Literals ......................................... 236 5.21 Designated Initializers ...................................... 237 5.22 Case
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages504 Page
-
File Size-