In Using the GNU Compiler Collection (GCC)
Total Page:16
File Type:pdf, Size:1020Kb
Using the GNU Compiler Collection For gcc version 4.9.3 (GCC) Richard M. Stallman and the GCC Developer Community Published by: GNU Press Website: http://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-2015 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 ::::::::::::::::::::: 343 5 C++ Implementation-defined behavior :::::::::::::::::: 351 6 Extensions to the C Language Family ::::::::::::::::::: 353 7 Extensions to the C++ Language :::::::::::::::::::::: 709 8 GNU Objective-C features :::::::::::::::::::::::::::: 723 9 Binary Compatibility :::::::::::::::::::::::::::::::: 739 10 gcov|a Test Coverage Program ::::::::::::::::::::::: 743 11 Known Causes of Trouble with GCC :::::::::::::::::::: 753 12 Reporting Bugs ::::::::::::::::::::::::::::::::::::: 769 13 How To Get Help with GCC :::::::::::::::::::::::::: 771 14 Contributing to GCC Development ::::::::::::::::::::: 773 Funding Free Software ::::::::::::::::::::::::::::::::::: 775 The GNU Project and GNU/Linux::::::::::::::::::::::::: 777 GNU General Public License :::::::::::::::::::::::::::::: 779 GNU Free Documentation License ::::::::::::::::::::::::: 791 Contributors to GCC :::::::::::::::::::::::::::::::::::: 799 Option Index :::::::::::::::::::::::::::::::::::::::::: 815 Keyword Index ::::::::::::::::::::::::::::::::::::::::: 835 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 ::::::::::::::::::::::: 25 3.3 Compiling C++ Programs :::::::::::::::::::::::::::::::::::: 31 3.4 Options Controlling C Dialect ::::::::::::::::::::::::::::::::: 31 3.5 Options Controlling C++ Dialect ::::::::::::::::::::::::::::: 37 3.6 Options Controlling Objective-C and Objective-C++ Dialects :: 48 3.7 Options to Control Diagnostic Messages Formatting ::::::::::: 52 3.8 Options to Request or Suppress Warnings ::::::::::::::::::::: 53 3.9 Options for Debugging Your Program or GCC ::::::::::::::::: 78 3.10 Options That Control Optimization ::::::::::::::::::::::::: 101 3.11 Options Controlling the Preprocessor:::::::::::::::::::::::: 155 3.12 Passing Options to the Assembler ::::::::::::::::::::::::::: 167 3.13 Options for Linking ::::::::::::::::::::::::::::::::::::::::: 167 3.14 Options for Directory Search :::::::::::::::::::::::::::::::: 171 3.15 Specifying subprocesses and the switches to pass to them :::: 173 3.16 Specifying Target Machine and Compiler Version :::::::::::: 180 3.17 Hardware Models and Configurations ::::::::::::::::::::::: 181 3.17.1 AArch64 Options :::::::::::::::::::::::::::::::::::::: 181 3.17.1.1 `-march' and `-mcpu' feature modifiers ::::::::::::: 183 3.17.2 Adapteva Epiphany Options ::::::::::::::::::::::::::: 183 3.17.3 ARC Options :::::::::::::::::::::::::::::::::::::::::: 185 3.17.4 ARM Options:::::::::::::::::::::::::::::::::::::::::: 191 3.17.5 AVR Options :::::::::::::::::::::::::::::::::::::::::: 197 3.17.5.1 EIND and Devices with more than 128 Ki Bytes of Flash :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 200 3.17.5.2 Handling of the RAMPD, RAMPX, RAMPY and RAMPZ Special Function Registers:::::::::::::::::::::::::::::::::::::: 202 3.17.5.3 AVR Built-in Macros:::::::::::::::::::::::::::::: 202 3.17.6 Blackfin Options ::::::::::::::::::::::::::::::::::::::: 204 iv Using the GNU Compiler Collection (GCC) 3.17.7 C6X Options::::::::::::::::::::::::::::::::::::::::::: 207 3.17.8 CRIS Options:::::::::::::::::::::::::::::::::::::::::: 208 3.17.9 CR16 Options ::::::::::::::::::::::::::::::::::::::::: 210 3.17.10 Darwin Options::::::::::::::::::::::::::::::::::::::: 210 3.17.11 DEC Alpha Options :::::::::::::::::::::::::::::::::: 214 3.17.12 FR30 Options :::::::::::::::::::::::::::::::::::::::: 218 3.17.13 FRV Options ::::::::::::::::::::::::::::::::::::::::: 218 3.17.14 GNU/Linux Options :::::::::::::::::::::::::::::::::: 222 3.17.15 H8/300 Options::::::::::::::::::::::::::::::::::::::: 223 3.17.16 HPPA Options:::::::::::::::::::::::::::::::::::::::: 223 3.17.17 Intel 386 and AMD x86-64 Options ::::::::::::::::::: 226 3.17.18 i386 and x86-64 Windows Options :::::::::::::::::::: 243 3.17.19 IA-64 Options :::::::::::::::::::::::::::::::::::::::: 244 3.17.20 LM32 Options :::::::::::::::::::::::::::::::::::::::: 248 3.17.21 M32C Options :::::::::::::::::::::::::::::::::::::::: 248 3.17.22 M32R/D Options ::::::::::::::::::::::::::::::::::::: 249 3.17.23 M680x0 Options :::::::::::::::::::::::::::::::::::::: 250 3.17.24 MCore Options ::::::::::::::::::::::::::::::::::::::: 255 3.17.25 MeP Options ::::::::::::::::::::::::::::::::::::::::: 256 3.17.26 MicroBlaze Options ::::::::::::::::::::::::::::::::::: 258 3.17.27 MIPS Options :::::::::::::::::::::::::::::::::::::::: 259 3.17.28 MMIX Options ::::::::::::::::::::::::::::::::::::::: 272 3.17.29 MN10300 Options :::::::::::::::::::::::::::::::::::: 273 3.17.30 Moxie Options :::::::::::::::::::::::::::::::::::::::: 274 3.17.31 MSP430 Options:::::::::::::::::::::::::::::::::::::: 274 3.17.32 NDS32 Options ::::::::::::::::::::::::::::::::::::::: 275 3.17.33 Nios II Options ::::::::::::::::::::::::::::::::::::::: 277 3.17.34 PDP-11 Options :::::::::::::::::::::::::::::::::::::: 280 3.17.35 picoChip Options ::::::::::::::::::::::::::::::::::::: 281 3.17.36 PowerPC Options::::::::::::::::::::::::::::::::::::: 282 3.17.37 RL78 Options::::::::::::::::::::::::::::::::::::::::: 282 3.17.38 IBM RS/6000 and PowerPC Options :::::::::::::::::: 282 3.17.39 RX Options :::::::::::::::::::::::::::::::::::::::::: 297 3.17.40 S/390 and zSeries Options :::::::::::::::::::::::::::: 300 3.17.41 Score Options::::::::::::::::::::::::::::::::::::::::: 303 3.17.42 SH Options ::::::::::::::::::::::::::::::::::::::::::: 303 3.17.43 Solaris 2 Options ::::::::::::::::::::::::::::::::::::: 312 3.17.44 SPARC Options :::::::::::::::::::::::::::::::::::::: 312 3.17.45 SPU Options ::::::::::::::::::::::::::::::::::::::::: 317 3.17.46 Options for System V ::::::::::::::::::::::::::::::::: 319 3.17.47 TILE-Gx Options ::::::::::::::::::::::::::::::::::::: 319 3.17.48 TILEPro Options ::::::::::::::::::::::::::::::::::::: 320 3.17.49 V850 Options ::::::::::::::::::::::::::::::::::::::::: 320 3.17.50 VAX Options ::::::::::::::::::::::::::::::::::::::::: 323 3.17.51 VMS Options ::::::::::::::::::::::::::::::::::::::::: 323 3.17.52 VxWorks Options ::::::::::::::::::::::::::::::::::::: 323 3.17.53 x86-64 Options ::::::::::::::::::::::::::::::::::::::: 324 3.17.54 Xstormy16 Options ::::::::::::::::::::::::::::::::::: 324 v 3.17.55 Xtensa Options ::::::::::::::::::::::::::::::::::::::: 324 3.17.56 zSeries Options ::::::::::::::::::::::::::::::::::::::: 326 3.18 Options for Code Generation Conventions ::::::::::::::::::: 326 3.19 Environment Variables Affecting GCC :::::::::::::::::::::: 336 3.20 Using Precompiled Headers ::::::::::::::::::::::::::::::::: 339 4 C Implementation-defined behavior :::::::: 343 4.1 Translation :::::::::::::::::::::::::::::::::::::::::::::::::: 343 4.2 Environment::::::::::::::::::::::::::::::::::::::::::::::::: 343 4.3 Identifiers:::::::::::::::::::::::::::::::::::::::::::::::::::: 343 4.4 Characters ::::::::::::::::::::::::::::::::::::::::::::::::::: 344 4.5 Integers:::::::::::::::::::::::::::::::::::::::::::::::::::::: 345 4.6 Floating point ::::::::::::::::::::::::::::::::::::::::::::::: 345 4.7 Arrays and pointers :::::::::::::::::::::::::::::::::::::::::: 346 4.8 Hints :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 347 4.9 Structures, unions, enumerations, and bit-fields ::::::::::::::: 347 4.10 Qualifiers ::::::::::::::::::::::::::::::::::::::::::::::::::: 348 4.11 Declarators ::::::::::::::::::::::::::::::::::::::::::::::::: 349 4.12 Statements ::::::::::::::::::::::::::::::::::::::::::::::::: 349 4.13 Preprocessing directives :::::::::::::::::::::::::::::::::::::