logo资料库

GCC编译器官方文档.pdf

第1页 / 共958页
第2页 / 共958页
第3页 / 共958页
第4页 / 共958页
第5页 / 共958页
第6页 / 共958页
第7页 / 共958页
第8页 / 共958页
资料共958页,剩余部分请下载后查看
Introduction
Programming Languages Supported by GCC
Language Standards Supported by GCC
C Language
C++ Language
Objective-C and Objective-C++ Languages
Go Language
HSA Intermediate Language (HSAIL)
References for Other Languages
GCC Command Options
Option Summary
Options Controlling the Kind of Output
Compiling C++ Programs
Options Controlling C Dialect
Options Controlling C++ Dialect
Options Controlling Objective-C and Objective-C++ Dialects
Options to Control Diagnostic Messages Formatting
Options to Request or Suppress Warnings
Options for Debugging Your Program
Options That Control Optimization
Program Instrumentation Options
Options Controlling the Preprocessor
Passing Options to the Assembler
Options for Linking
Options for Directory Search
Options for Code Generation Conventions
GCC Developer Options
Machine-Dependent Options
AArch64 Options
-march and -mcpu Feature Modifiers
Adapteva Epiphany Options
ARC Options
ARM Options
AVR Options
EIND and Devices with More Than 128 Ki Bytes of Flash
Handling of the RAMPD, RAMPX, RAMPY and RAMPZ Special Function Registers
AVR Built-in Macros
Blackfin Options
C6X Options
CRIS Options
CR16 Options
Darwin Options
DEC Alpha Options
FR30 Options
FT32 Options
FRV Options
GNU/Linux Options
H8/300 Options
HPPA Options
IA-64 Options
LM32 Options
M32C Options
M32R/D Options
M680x0 Options
MCore Options
MeP Options
MicroBlaze Options
MIPS Options
MMIX Options
MN10300 Options
Moxie Options
MSP430 Options
NDS32 Options
Nios II Options
Nvidia PTX Options
PDP-11 Options
picoChip Options
PowerPC Options
PowerPC SPE Options
RISC-V Options
RL78 Options
IBM RS/6000 and PowerPC Options
RX Options
S/390 and zSeries Options
Score Options
SH Options
Solaris 2 Options
SPARC Options
SPU Options
Options for System V
TILE-Gx Options
TILEPro Options
V850 Options
VAX Options
Visium Options
VMS Options
VxWorks Options
x86 Options
x86 Windows Options
Xstormy16 Options
Xtensa Options
zSeries Options
Specifying Subprocesses and the Switches to Pass to Them
Environment Variables Affecting GCC
Using Precompiled Headers
C Implementation-Defined Behavior
Translation
Environment
Identifiers
Characters
Integers
Floating Point
Arrays and Pointers
Hints
Structures, Unions, Enumerations, and Bit-Fields
Qualifiers
Declarators
Statements
Preprocessing Directives
Library Functions
Architecture
Locale-Specific Behavior
C++ Implementation-Defined Behavior
Conditionally-Supported Behavior
Exception Handling
Extensions to the C Language Family
Statements and Declarations in Expressions
Locally Declared Labels
Labels as Values
Nested Functions
Constructing Function Calls
Referring to a Type with typeof
Conditionals with Omitted Operands
128-bit Integers
Double-Word Integers
Complex Numbers
Additional Floating Types
Half-Precision Floating Point
Decimal Floating Types
Hex Floats
Fixed-Point Types
Named Address Spaces
AVR Named Address Spaces
M32C Named Address Spaces
RL78 Named Address Spaces
SPU Named Address Spaces
x86 Named Address Spaces
Arrays of Length Zero
Structures with No Members
Arrays of Variable Length
Macros with a Variable Number of Arguments.
Slightly Looser Rules for Escaped Newlines
Non-Lvalue Arrays May Have Subscripts
Arithmetic on void- and Function-Pointers
Pointers to Arrays with Qualifiers Work as Expected
Non-Constant Initializers
Compound Literals
Designated Initializers
Case Ranges
Cast to a Union Type
Mixed Declarations and Code
Declaring Attributes of Functions
Common Function Attributes
AArch64 Function Attributes
Inlining rules
ARC Function Attributes
ARM Function Attributes
AVR Function Attributes
Blackfin Function Attributes
CR16 Function Attributes
Epiphany Function Attributes
H8/300 Function Attributes
IA-64 Function Attributes
M32C Function Attributes
M32R/D Function Attributes
m68k Function Attributes
MCORE Function Attributes
MeP Function Attributes
MicroBlaze Function Attributes
Microsoft Windows Function Attributes
MIPS Function Attributes
MSP430 Function Attributes
NDS32 Function Attributes
Nios II Function Attributes
Nvidia PTX Function Attributes
PowerPC Function Attributes
RISC-V Function Attributes
RL78 Function Attributes
RX Function Attributes
S/390 Function Attributes
SH Function Attributes
SPU Function Attributes
Symbian OS Function Attributes
V850 Function Attributes
Visium Function Attributes
x86 Function Attributes
Xstormy16 Function Attributes
Specifying Attributes of Variables
Common Variable Attributes
ARC Variable Attributes
AVR Variable Attributes
Blackfin Variable Attributes
H8/300 Variable Attributes
IA-64 Variable Attributes
M32R/D Variable Attributes
MeP Variable Attributes
Microsoft Windows Variable Attributes
MSP430 Variable Attributes
Nvidia PTX Variable Attributes
PowerPC Variable Attributes
RL78 Variable Attributes
SPU Variable Attributes
V850 Variable Attributes
x86 Variable Attributes
Xstormy16 Variable Attributes
Specifying Attributes of Types
Common Type Attributes
ARC Type Attributes
ARM Type Attributes
MeP Type Attributes
PowerPC Type Attributes
SPU Type Attributes
x86 Type Attributes
Label Attributes
Enumerator Attributes
Statement Attributes
Attribute Syntax
Prototypes and Old-Style Function Definitions
C++ Style Comments
Dollar Signs in Identifier Names
The Character ESC in Constants
Inquiring on Alignment of Types or Variables
An Inline Function is As Fast As a Macro
When is a Volatile Object Accessed?
How to Use Inline Assembly Language in C Code
Basic Asm --- Assembler Instructions Without Operands
Extended Asm - Assembler Instructions with C Expression Operands
Volatile
Assembler Template
Output Operands
Flag Output Operands
Input Operands
Clobbers and Scratch Registers
Goto Labels
x86 Operand Modifiers
x86 Floating-Point asm Operands
Constraints for asm Operands
Simple Constraints
Multiple Alternative Constraints
Constraint Modifier Characters
Constraints for Particular Machines
Controlling Names Used in Assembler Code
Variables in Specified Registers
Defining Global Register Variables
Specifying Registers for Local Variables
Size of an asm
Alternate Keywords
Incomplete enum Types
Function Names as Strings
Getting the Return or Frame Address of a Function
Using Vector Instructions through Built-in Functions
Support for offsetof
Legacy __sync Built-in Functions for Atomic Memory Access
Built-in Functions for Memory Model Aware Atomic Operations
Built-in Functions to Perform Arithmetic with Overflow Checking
x86-Specific Memory Model Extensions for Transactional Memory
Object Size Checking Built-in Functions
Pointer Bounds Checker Built-in Functions
Other Built-in Functions Provided by GCC
Built-in Functions Specific to Particular Target Machines
AArch64 Built-in Functions
Alpha Built-in Functions
Altera Nios II Built-in Functions
ARC Built-in Functions
ARC SIMD Built-in Functions
ARM iWMMXt Built-in Functions
ARM C Language Extensions (ACLE)
ARM Floating Point Status and Control Intrinsics
ARM ARMv8-M Security Extensions
AVR Built-in Functions
Blackfin Built-in Functions
FR-V Built-in Functions
Argument Types
Directly-Mapped Integer Functions
Directly-Mapped Media Functions
Raw Read/Write Functions
Other Built-in Functions
MIPS DSP Built-in Functions
MIPS Paired-Single Support
MIPS Loongson Built-in Functions
Paired-Single Arithmetic
Paired-Single Built-in Functions
MIPS-3D Built-in Functions
MIPS SIMD Architecture (MSA) Support
MIPS SIMD Architecture Built-in Functions
Other MIPS Built-in Functions
MSP430 Built-in Functions
NDS32 Built-in Functions
picoChip Built-in Functions
PowerPC Built-in Functions
PowerPC AltiVec Built-in Functions
PowerPC Hardware Transactional Memory Built-in Functions
PowerPC HTM Low Level Built-in Functions
PowerPC HTM High Level Inline Functions
PowerPC Atomic Memory Operation Functions
RX Built-in Functions
S/390 System z Built-in Functions
SH Built-in Functions
SPARC VIS Built-in Functions
SPU Built-in Functions
TI C6X Built-in Functions
TILE-Gx Built-in Functions
TILEPro Built-in Functions
x86 Built-in Functions
x86 Transactional Memory Intrinsics
x86 Control-Flow Protection Intrinsics
Format Checks Specific to Particular Target Machines
Solaris Format Checks
Darwin Format Checks
Pragmas Accepted by GCC
AArch64 Pragmas
ARM Pragmas
M32C Pragmas
MeP Pragmas
RS/6000 and PowerPC Pragmas
S/390 Pragmas
Darwin Pragmas
Solaris Pragmas
Symbol-Renaming Pragmas
Structure-Layout Pragmas
Weak Pragmas
Diagnostic Pragmas
Visibility Pragmas
Push/Pop Macro Pragmas
Function Specific Option Pragmas
Loop-Specific Pragmas
Unnamed Structure and Union Fields
Thread-Local Storage
ISO/IEC 9899:1999 Edits for Thread-Local Storage
ISO/IEC 14882:1998 Edits for Thread-Local Storage
Binary Constants using the 0b Prefix
Extensions to the C++ Language
When is a Volatile C++ Object Accessed?
Restricting Pointer Aliasing
Vague Linkage
C++ Interface and Implementation Pragmas
Where's the Template?
Extracting the Function Pointer from a Bound Pointer to Member Function
C++-Specific Variable, Function, and Type Attributes
Function Multiversioning
Type Traits
C++ Concepts
Deprecated Features
Backwards Compatibility
GNU Objective-C Features
GNU Objective-C Runtime API
Modern GNU Objective-C Runtime API
Traditional GNU Objective-C Runtime API
+load: Executing Code before main
What You Can and Cannot Do in +load
Type Encoding
Legacy Type Encoding
@encode
Method Signatures
Garbage Collection
Constant String Objects
compatibility_alias
Exceptions
Synchronization
Fast Enumeration
Using Fast Enumeration
C99-Like Fast Enumeration Syntax
Fast Enumeration Details
Fast Enumeration Protocol
Messaging with the GNU Objective-C Runtime
Dynamically Registering Methods
Forwarding Hook
Binary Compatibility
gcov---a Test Coverage Program
Introduction to gcov
Invoking gcov
Using gcov with GCC Optimization
Brief Description of gcov Data Files
Data File Relocation to Support Cross-Profiling
gcov-tool---an Offline Gcda Profile Processing Tool
Introduction to gcov-tool
Invoking gcov-tool
gcov-dump---an Offline Gcda and Gcno Profile Dump Tool
Introduction to gcov-dump
Invoking gcov-dump
Known Causes of Trouble with GCC
Actual Bugs We Haven't Fixed Yet
Interoperation
Incompatibilities of GCC
Fixed Header Files
Standard Libraries
Disappointments and Misunderstandings
Common Misunderstandings with GNU C++
Declare and Define Static Members
Name Lookup, Templates, and Accessing Members of Base Classes
Temporaries May Vanish Before You Expect
Implicit Copy-Assignment for Virtual Bases
Certain Changes We Don't Want to Make
Warning Messages and Error Messages
Reporting Bugs
Have You Found a Bug?
How and Where to Report Bugs
How To Get Help with GCC
Contributing to GCC Development
Funding Free Software
The GNU Project and GNU/Linux
GNU General Public License
GNU Free Documentation License
ADDENDUM: How to use this License for your documents
Contributors to GCC
Option Index
Keyword Index
Using the GNU Compiler Collection For gcc version 8.2.0 (GCC) Richard M. Stallman and the GCC Developer Community
Published by: GNU Press a division of the Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA Website: http://www.gnupress.org General: press@gnu.org Orders: sales@gnu.org Tel 617-542-5942 Fax 617-542-2652 Last printed October 2003 for GCC 3.3.1. Printed copies are available for $45 each. Copyright c 1988-2018 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 Programming Languages Supported by GCC . . . . . . . . . . . . . . . 3 1 Language Standards Supported by GCC . . . . . . . . . . . . . . . . . . 5 2 3 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 C Implementation-Defined Behavior . . . . . . . . . . . . . . . . . . . . 429 4 C++ Implementation-Defined Behavior . . . . . . . . . . . . . . . . . 437 5 Extensions to the C Language Family . . . . . . . . . . . . . . . . . . . 439 6 Extensions to the C++ Language . . . . . . . . . . . . . . . . . . . . . . 787 7 8 GNU Objective-C Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 801 Binary Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817 9 10 gcov—a Test Coverage Program . . . . . . . . . . . . . . . . . . . . . . . 821 11 gcov-tool—an Offline Gcda Profile Processing Tool . . . . . . . 833 12 gcov-dump—an Offline Gcda and Gcno Profile Dump Tool . . 837 13 Known Causes of Trouble with GCC . . . . . . . . . . . . . . . . . . . . 839 14 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855 15 How To Get Help with GCC . . . . . . . . . . . . . . . . . . . . . . . . . . 857 16 Contributing to GCC Development . . . . . . . . . . . . . . . . . . . . . 859 Funding Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861 The GNU Project and GNU/Linux. . . . . . . . . . . . . . . . . . . . . . . . . 863 GNU General Public License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865 GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . 877 Contributors to GCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885 Option Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903 Keyword Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927
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 HSA Intermediate Language (HSAIL) . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.6 References for Other Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . . 9 3.1 Option Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2 Options Controlling the Kind of Output . . . . . . . . . . . . . . . . . . . . . . . 29 3.3 Compiling C++ Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.4 Options Controlling C Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.5 Options Controlling C++ Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.6 Options Controlling Objective-C and Objective-C++ Dialects . . 55 3.7 Options to Control Diagnostic Messages Formatting . . . . . . . . . . . 59 3.8 Options to Request or Suppress Warnings . . . . . . . . . . . . . . . . . . . . . 62 3.9 Options for Debugging Your Program . . . . . . . . . . . . . . . . . . . . . . . . 108 3.10 Options That Control Optimization . . . . . . . . . . . . . . . . . . . . . . . . . 114 3.11 Program Instrumentation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 3.12 Options Controlling the Preprocessor. . . . . . . . . . . . . . . . . . . . . . . . 187 3.13 Passing Options to the Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 3.14 Options for Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 3.15 Options for Directory Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 3.16 Options for Code Generation Conventions . . . . . . . . . . . . . . . . . . . 202 3.17 GCC Developer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 3.18 Machine-Dependent Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 3.18.1 AArch64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 3.18.1.1 ‘-march’ and ‘-mcpu’ Feature Modifiers . . . . . . . . . . . . 232 3.18.2 Adapteva Epiphany Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 3.18.3 ARC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 3.18.4 ARM Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 3.18.5 AVR Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 3.18.5.1 EIND and Devices with More Than 128 Ki Bytes of Flash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 3.18.5.2 Handling of the RAMPD, RAMPX, RAMPY and RAMPZ Special Function Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
iv Using the GNU Compiler Collection (GCC) 3.18.5.3 AVR Built-in Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 3.18.6 Blackfin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 3.18.7 C6X Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 3.18.8 CRIS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 3.18.9 CR16 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 3.18.10 Darwin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 3.18.11 DEC Alpha Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 3.18.12 FR30 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 3.18.13 FT32 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 3.18.14 FRV Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 3.18.15 GNU/Linux Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 3.18.16 H8/300 Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 3.18.17 HPPA Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 3.18.18 IA-64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 3.18.19 LM32 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 3.18.20 M32C Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 3.18.21 M32R/D Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 3.18.22 M680x0 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 3.18.23 MCore Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 3.18.24 MeP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 3.18.25 MicroBlaze Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 3.18.26 MIPS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 3.18.27 MMIX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 3.18.28 MN10300 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 3.18.29 Moxie Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 3.18.30 MSP430 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 3.18.31 NDS32 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 3.18.32 Nios II Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 3.18.33 Nvidia PTX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 3.18.34 PDP-11 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 3.18.35 picoChip Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 3.18.36 PowerPC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 3.18.37 PowerPC SPE Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 3.18.38 RISC-V Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 3.18.39 RL78 Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 3.18.40 IBM RS/6000 and PowerPC Options . . . . . . . . . . . . . . . . . . 345 3.18.41 RX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 3.18.42 S/390 and zSeries Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 3.18.43 Score Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 3.18.44 SH Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 3.18.45 Solaris 2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 3.18.46 SPARC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 3.18.47 SPU Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 3.18.48 Options for System V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 3.18.49 TILE-Gx Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 3.18.50 TILEPro Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 3.18.51 V850 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 3.18.52 VAX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
v 3.18.53 Visium Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 3.18.54 VMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 3.18.55 VxWorks Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 3.18.56 x86 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 3.18.57 x86 Windows Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 3.18.58 Xstormy16 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 3.18.59 Xtensa Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 3.18.60 zSeries Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 3.19 Specifying Subprocesses and the Switches to Pass to Them . . 415 3.20 Environment Variables Affecting GCC . . . . . . . . . . . . . . . . . . . . . . 422 3.21 Using Precompiled Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 4 C Implementation-Defined Behavior . . . . . . . 429 4.1 Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 4.2 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 4.3 Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 4.4 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 4.5 Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 4.6 Floating Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 4.7 Arrays and Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 4.8 Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 4.9 Structures, Unions, Enumerations, and Bit-Fields . . . . . . . . . . . . . 433 4.10 Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 4.11 Declarators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 4.12 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 4.13 Preprocessing Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 4.14 Library Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 4.15 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 4.16 Locale-Specific Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 5 C++ Implementation-Defined Behavior . . . 437 5.1 Conditionally-Supported Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 5.2 Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 6 Extensions to the C Language Family . . . . . . 439 6.1 Statements and Declarations in Expressions . . . . . . . . . . . . . . . . . . 439 6.2 Locally Declared Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440 6.3 Labels as Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 6.4 Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 6.5 Constructing Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 6.6 Referring to a Type with typeof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 6.7 Conditionals with Omitted Operands . . . . . . . . . . . . . . . . . . . . . . . . . 447 6.8 128-bit Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 6.9 Double-Word Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 6.10 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 6.11 Additional Floating Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 6.12 Half-Precision Floating Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
vi Using the GNU Compiler Collection (GCC) 6.13 Decimal Floating Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 6.14 Hex Floats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 6.15 Fixed-Point Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 6.16 Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 6.16.1 AVR Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 6.16.2 M32C Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . 455 6.16.3 RL78 Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 6.16.4 SPU Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 6.16.5 x86 Named Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 6.17 Arrays of Length Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 6.18 Structures with No Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 6.19 Arrays of Variable Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 6.20 Macros with a Variable Number of Arguments. . . . . . . . . . . . . . . 458 6.21 Slightly Looser Rules for Escaped Newlines . . . . . . . . . . . . . . . . . . 459 6.22 Non-Lvalue Arrays May Have Subscripts . . . . . . . . . . . . . . . . . . . . 459 6.23 Arithmetic on void- and Function-Pointers . . . . . . . . . . . . . . . . . . 459 6.24 Pointers to Arrays with Qualifiers Work as Expected . . . . . . . . 460 6.25 Non-Constant Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 6.26 Compound Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 6.27 Designated Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 6.28 Case Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 6.29 Cast to a Union Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 6.30 Mixed Declarations and Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 6.31 Declaring Attributes of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 6.31.1 Common Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . 464 6.31.2 AArch64 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . 481 6.31.2.1 Inlining rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 6.31.3 ARC Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 6.31.4 ARM Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 6.31.5 AVR Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486 6.31.6 Blackfin Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 6.31.7 CR16 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488 6.31.8 Epiphany Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . 488 6.31.9 H8/300 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489 6.31.10 IA-64 Function Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490 6.31.11 M32C Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490 6.31.12 M32R/D Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 491 6.31.13 m68k Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 6.31.14 MCORE Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 492 6.31.15 MeP Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 6.31.16 MicroBlaze Function Attributes . . . . . . . . . . . . . . . . . . . . . . . 492 6.31.17 Microsoft Windows Function Attributes . . . . . . . . . . . . . . . 493 6.31.18 MIPS Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494 6.31.19 MSP430 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . 496 6.31.20 NDS32 Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 6.31.21 Nios II Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 498 6.31.22 Nvidia PTX Function Attributes . . . . . . . . . . . . . . . . . . . . . . 499 6.31.23 PowerPC Function Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 499
分享到:
收藏