Using the GNU Compiler Collection (GCC)
This file documents the use of the GNU compilers. Copyright © 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.
Short Contents
- Introduction
- 1 Programming Languages Supported by GCC
- 2 Language Standards Supported by GCC
- 3 GCC Command Options
- 4 C Implementation-Defined Behavior
- 5 C++ Implementation-Defined Behavior
- 6 Extensions to the C Language Family
- 7 Extensions to the C++ Language
- 8 GNU Objective-C Features
- 9 Binary Compatibility
- 10
gcov
—a Test Coverage Program - 11
gcov-tool
—an Offline Gcda Profile Processing Tool - 12 Known Causes of Trouble with GCC
- 13 Reporting Bugs
- 14 How To Get Help with GCC
- 15 Contributing to GCC Development
- Funding Free Software
- The GNU Project and GNU/Linux
- GNU General Public License
- GNU Free Documentation License
- Contributors to GCC
- Option Index
- Keyword Index
Table of Contents
- Introduction
- 1 Programming Languages Supported by GCC
- 2 Language Standards Supported by GCC
-
3 GCC Command Options
- 3.1 Option Summary
- 3.2 Options Controlling the Kind of Output
- 3.3 Compiling C++ Programs
- 3.4 Options Controlling C Dialect
- 3.5 Options Controlling C++ Dialect
- 3.6 Options Controlling Objective-C and Objective-C++ Dialects
- 3.7 Options to Control Diagnostic Messages Formatting
- 3.8 Options to Request or Suppress Warnings
- 3.9 Options for Debugging Your Program or GCC
- 3.10 Options That Control Optimization
- 3.11 Options Controlling the Preprocessor
- 3.12 Passing Options to the Assembler
- 3.13 Options for Linking
- 3.14 Options for Directory Search
- 3.15 Specifying Subprocesses and the Switches to Pass to Them
- 3.16 Specifying Target Machine and Compiler Version
-
3.17 Hardware Models and Configurations
- 3.17.1 AArch64 Options
- 3.17.2 Adapteva Epiphany Options
- 3.17.3 ARC Options
- 3.17.4 ARM Options
- 3.17.5 AVR Options
- 3.17.6 Blackfin Options
- 3.17.7 C6X Options
- 3.17.8 CRIS Options
- 3.17.9 CR16 Options
- 3.17.10 Darwin Options
- 3.17.11 DEC Alpha Options
- 3.17.12 FR30 Options
- 3.17.13 FRV Options
- 3.17.14 GNU/Linux Options
- 3.17.15 H8/300 Options
- 3.17.16 HPPA Options
- 3.17.17 IA-64 Options
- 3.17.18 LM32 Options
- 3.17.19 M32C Options
- 3.17.20 M32R/D Options
- 3.17.21 M680x0 Options
- 3.17.22 MCore Options
- 3.17.23 MeP Options
- 3.17.24 MicroBlaze Options
- 3.17.25 MIPS Options
- 3.17.26 MMIX Options
- 3.17.27 MN10300 Options
- 3.17.28 Moxie Options
- 3.17.29 MSP430 Options
- 3.17.30 NDS32 Options
- 3.17.31 Nios II Options
- 3.17.32 Nvidia PTX Options
- 3.17.33 PDP-11 Options
- 3.17.34 picoChip Options
- 3.17.35 PowerPC Options
- 3.17.36 RL78 Options
- 3.17.37 IBM RS/6000 and PowerPC Options
- 3.17.38 RX Options
- 3.17.39 S/390 and zSeries Options
- 3.17.40 Score Options
- 3.17.41 SH Options
- 3.17.42 Solaris 2 Options
- 3.17.43 SPARC Options
- 3.17.44 SPU Options
- 3.17.45 Options for System V
- 3.17.46 TILE-Gx Options
- 3.17.47 TILEPro Options
- 3.17.48 V850 Options
- 3.17.49 VAX Options
- 3.17.50 Visium Options
- 3.17.51 VMS Options
- 3.17.52 VxWorks Options
- 3.17.53 x86 Options
- 3.17.54 x86 Windows Options
- 3.17.55 Xstormy16 Options
- 3.17.56 Xtensa Options
- 3.17.57 zSeries Options
- 3.18 Options for Code Generation Conventions
- 3.19 Environment Variables Affecting GCC
- 3.20 Using Precompiled Headers
-
4 C Implementation-Defined Behavior
- 4.1 Translation
- 4.2 Environment
- 4.3 Identifiers
- 4.4 Characters
- 4.5 Integers
- 4.6 Floating Point
- 4.7 Arrays and Pointers
- 4.8 Hints
- 4.9 Structures, Unions, Enumerations, and Bit-Fields
- 4.10 Qualifiers
- 4.11 Declarators
- 4.12 Statements
- 4.13 Preprocessing Directives
- 4.14 Library Functions
- 4.15 Architecture
- 4.16 Locale-Specific Behavior
- 5 C++ Implementation-Defined Behavior
-
6 Extensions to the C Language Family
- 6.1 Statements and Declarations in Expressions
- 6.2 Locally Declared Labels
- 6.3 Labels as Values
- 6.4 Nested Functions
- 6.5 Constructing Function Calls
-
6.6 Referring to a Type with
typeof
- 6.7 Conditionals with Omitted Operands
- 6.8 128-bit Integers
- 6.9 Double-Word Integers
- 6.10 Complex Numbers
- 6.11 Additional Floating Types
- 6.12 Half-Precision Floating Point
- 6.13 Decimal Floating Types
- 6.14 Hex Floats
- 6.15 Fixed-Point Types
- 6.16 Named Address Spaces
- 6.17 Arrays of Length Zero
- 6.18 Structures with No Members
- 6.19 Arrays of Variable Length
- 6.20 Macros with a Variable Number of Arguments.
- 6.21 Slightly Looser Rules for Escaped Newlines
- 6.22 Non-Lvalue Arrays May Have Subscripts
-
6.23 Arithmetic on
void
- and Function-Pointers - 6.24 Pointers to Arrays with Qualifiers Work as Expected
- 6.25 Non-Constant Initializers
- 6.26 Compound Literals
- 6.27 Designated Initializers
- 6.28 Case Ranges
- 6.29 Cast to a Union Type
- 6.30 Mixed Declarations and Code
- 6.31 Declaring Attributes of Functions
- 6.32 Label Attributes
- 6.33 Attribute Syntax
- 6.34 Prototypes and Old-Style Function Definitions
- 6.35 C++ Style Comments
- 6.36 Dollar Signs in Identifier Names
- 6.37 The Character <ESC> in Constants
-
6.38 Specifying Attributes of Variables
- 6.38.1 AVR Variable Attributes
- 6.38.2 Blackfin Variable Attributes
- 6.38.3 H8/300 Variable Attributes
- 6.38.4 IA-64 Variable Attributes
- 6.38.5 M32R/D Variable Attributes
- 6.38.6 MeP Variable Attributes
- 6.38.7 PowerPC Variable Attributes
- 6.38.8 SPU Variable Attributes
- 6.38.9 x86 Variable Attributes
- 6.38.10 Xstormy16 Variable Attributes
- 6.39 Specifying Attributes of Types
- 6.40 Inquiring on Alignment of Types or Variables
- 6.41 An Inline Function is As Fast As a Macro
- 6.42 When is a Volatile Object Accessed?
- 6.43 How to Use Inline Assembly Language in C Code
- 6.44 Alternate Keywords
-
6.45 Incomplete
enum
Types - 6.46 Function Names as Strings
- 6.47 Getting the Return or Frame Address of a Function
- 6.48 Using Vector Instructions through Built-in Functions
-
6.49 Support for
offsetof
-
6.50 Legacy
__sync
Built-in Functions for Atomic Memory Access - 6.51 Built-in Functions for Memory Model Aware Atomic Operations
- 6.52 Built-in Functions to Perform Arithmetic with Overflow Checking
- 6.53 x86-Specific Memory Model Extensions for Transactional Memory
- 6.54 Object Size Checking Built-in Functions
- 6.55 Pointer Bounds Checker Built-in Functions
- 6.56 Cilk Plus C/C++ Language Extension Built-in Functions
- 6.57 Other Built-in Functions Provided by GCC
-
6.58 Built-in Functions Specific to Particular Target Machines
- 6.58.1 AArch64 Built-in Functions
- 6.58.2 Alpha Built-in Functions
- 6.58.3 Altera Nios II Built-in Functions
- 6.58.4 ARC Built-in Functions
- 6.58.5 ARC SIMD Built-in Functions
- 6.58.6 ARM iWMMXt Built-in Functions
- 6.58.7 ARM C Language Extensions (ACLE)
- 6.58.8 ARM Floating Point Status and Control Intrinsics
- 6.58.9 AVR Built-in Functions
- 6.58.10 Blackfin Built-in Functions
- 6.58.11 FR-V Built-in Functions
- 6.58.12 MIPS DSP Built-in Functions
- 6.58.13 MIPS Paired-Single Support
- 6.58.14 MIPS Loongson Built-in Functions
- 6.58.15 Other MIPS Built-in Functions
- 6.58.16 MSP430 Built-in Functions
- 6.58.17 NDS32 Built-in Functions
- 6.58.18 picoChip Built-in Functions
- 6.58.19 PowerPC Built-in Functions
- 6.58.20 PowerPC AltiVec Built-in Functions
- 6.58.21 PowerPC Hardware Transactional Memory Built-in Functions
- 6.58.22 RX Built-in Functions
- 6.58.23 S/390 System z Built-in Functions
- 6.58.24 SH Built-in Functions
- 6.58.25 SPARC VIS Built-in Functions
- 6.58.26 SPU Built-in Functions
- 6.58.27 TI C6X Built-in Functions
- 6.58.28 TILE-Gx Built-in Functions
- 6.58.29 TILEPro Built-in Functions
- 6.58.30 x86 Built-in Functions
- 6.58.31 x86 Transactional Memory Intrinsics
- 6.59 Format Checks Specific to Particular Target Machines
-
6.60 Pragmas Accepted by GCC
- 6.60.1 ARM Pragmas
- 6.60.2 M32C Pragmas
- 6.60.3 MeP Pragmas
- 6.60.4 RS/6000 and PowerPC Pragmas
- 6.60.5 Darwin Pragmas
- 6.60.6 Solaris Pragmas
- 6.60.7 Symbol-Renaming Pragmas
- 6.60.8 Structure-Packing Pragmas
- 6.60.9 Weak Pragmas
- 6.60.10 Diagnostic Pragmas
- 6.60.11 Visibility Pragmas
- 6.60.12 Push/Pop Macro Pragmas
- 6.60.13 Function Specific Option Pragmas
- 6.60.14 Loop-Specific Pragmas
- 6.61 Unnamed Structure and Union Fields
- 6.62 Thread-Local Storage
-
6.63 Binary Constants using the ‘
0b
’ Prefix
-
7 Extensions to the C++ Language
- 7.1 When is a Volatile C++ Object Accessed?
- 7.2 Restricting Pointer Aliasing
- 7.3 Vague Linkage
- 7.4 C++ Interface and Implementation Pragmas
- 7.5 Where's the Template?
- 7.6 Extracting the Function Pointer from a Bound Pointer to Member Function
- 7.7 C++-Specific Variable, Function, and Type Attributes
- 7.8 Function Multiversioning
- 7.9 Namespace Association
- 7.10 Type Traits
- 7.11 Java Exceptions
- 7.12 Deprecated Features
- 7.13 Backwards Compatibility
- 8 GNU Objective-C Features
- 9 Binary Compatibility
-
10
gcov
—a Test Coverage Program -
11
gcov-tool
—an Offline Gcda Profile Processing Tool -
12 Known Causes of Trouble with GCC
- 12.1 Actual Bugs We Haven't Fixed Yet
- 12.2 Interoperation
- 12.3 Incompatibilities of GCC
- 12.4 Fixed Header Files
- 12.5 Standard Libraries
- 12.6 Disappointments and Misunderstandings
- 12.7 Common Misunderstandings with GNU C++
- 12.8 Certain Changes We Don't Want to Make
- 12.9 Warning Messages and Error Messages
- 13 Reporting Bugs
- 14 How To Get Help with GCC
- 15 Contributing to GCC Development
- Funding Free Software
- The GNU Project and GNU/Linux
- GNU General Public License
- GNU Free Documentation License
- Contributors to GCC
- Option Index
- Keyword Index
Introduction
This manual documents how to use the GNU compilers, as well as their features and incompatibilities, and how to report bugs. It corresponds to the compilers (GCC) version 5.4.0. The internals of the GNU compilers, including how to port them to new targets and some information about how to write front ends for new languages, are documented in a separate manual. See Introduction.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc/index.html