Using the GNU Compiler Collection
For gcc version 10.3.1
(GNU Arm Embedded Toolchain 10.3-2021.10)
Richard M. Stallman and the GCC Developer Community
Published by:
GNU Press Website: http://www.gnupress.org
a division of the General: press@gnu.org
Free Software Foundation Orders: sales@gnu.org
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-2020 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 C Implementation-Defined Behavior . . . . . . . . . . . . . . . . . . . . 465
5 C++ Implementation-Defined Behavior . . . . . . . . . . . . . . . . . 475
6 Extensions to the C Language Family . . . . . . . . . . . . . . . . . . . 477
7 Extensions to the C++ Language . . . . . . . . . . . . . . . . . . . . . . 843
8 GNU Objective-C Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
9 Binary Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
10 gcov—a Test Coverage Program . . . . . . . . . . . . . . . . . . . . . . . 877
11 gcov-tool—an Offline Gcda Profile Processing Tool . . . . . . . 891
12 gcov-dump—an Offline Gcda and Gcno Profile Dump Tool . . 895
13 lto-dump—Tool for dumping LTO object files. . . . . . . . . . . . 897
14 Known Causes of Trouble with GCC . . . . . . . . . . . . . . . . . . . . 899
15 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915
16 How To Get Help with GCC . . . . . . . . . . . . . . . . . . . . . . . . . . 917
17 Contributing to GCC Development . . . . . . . . . . . . . . . . . . . . . 919
Funding Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921
The GNU Project and GNU/Linux. . . . . . . . . . . . . . . . . . . . . . . . . 923
GNU General Public License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . 937
Contributors to GCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
Option Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
Keyword Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989
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 D language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.7 References for Other Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 GCC Command Options . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Option Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Options Controlling the Kind of Output . . . . . . . . . . . . . . . . . . . . . . . 32
3.3 Compiling C++ Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.4 Options Controlling C Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.5 Options Controlling C++ Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.6 Options Controlling Objective-C and Objective-C++ Dialects . . 63
3.7 Options to Control Diagnostic Messages Formatting . . . . . . . . . . . 67
3.8 Options to Request or Suppress Warnings . . . . . . . . . . . . . . . . . . . . . 76
3.9 Options That Control Static Analysis . . . . . . . . . . . . . . . . . . . . . . . . 125
3.10 Options for Debugging Your Program . . . . . . . . . . . . . . . . . . . . . . . 130
3.11 Options That Control Optimization . . . . . . . . . . . . . . . . . . . . . . . . . 137
3.12 Program Instrumentation Options. . . . . . . . . . . . . . . . . . . . . . . . . . . 204
3.13 Options Controlling the Preprocessor. . . . . . . . . . . . . . . . . . . . . . . . 218
3.14 Passing Options to the Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
3.15 Options for Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
3.16 Options for Directory Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
3.17 Options for Code Generation Conventions . . . . . . . . . . . . . . . . . . . 234
3.18 GCC Developer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
3.19 Machine-Dependent Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
3.19.1 AArch64 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
3.19.1.1 ‘-march’ and ‘-mcpu’ Feature Modifiers . . . . . . . . . . . . 267
3.19.2 Adapteva Epiphany Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
3.19.3 AMD GCN Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
3.19.4 ARC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
3.19.5 ARM Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
3.19.6 AVR Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297