head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC4:1.1.1.15 netbsd-11-0-RC3:1.1.1.15 netbsd-11-0-RC2:1.1.1.15 netbsd-11-0-RC1:1.1.1.15 gcc-14-3-0:1.1.1.16 perseant-exfatfs-base-20250801:1.1.1.15 netbsd-11:1.1.1.15.0.2 netbsd-11-base:1.1.1.15 gcc-12-5-0:1.1.1.15 netbsd-10-1-RELEASE:1.1.1.13 perseant-exfatfs-base-20240630:1.1.1.15 gcc-12-4-0:1.1.1.15 perseant-exfatfs:1.1.1.14.0.2 perseant-exfatfs-base:1.1.1.14 netbsd-8-3-RELEASE:1.1.1.4 netbsd-9-4-RELEASE:1.1.1.7 netbsd-10-0-RELEASE:1.1.1.13 netbsd-10-0-RC6:1.1.1.13 netbsd-10-0-RC5:1.1.1.13 netbsd-10-0-RC4:1.1.1.13 netbsd-10-0-RC3:1.1.1.13 netbsd-10-0-RC2:1.1.1.13 netbsd-10-0-RC1:1.1.1.13 gcc-12-3-0:1.1.1.14 gcc-10-5-0:1.1.1.13 netbsd-10:1.1.1.13.0.6 netbsd-10-base:1.1.1.13 netbsd-9-3-RELEASE:1.1.1.7 gcc-10-4-0:1.1.1.13 cjep_sun2x-base1:1.1.1.13 cjep_sun2x:1.1.1.13.0.4 cjep_sun2x-base:1.1.1.13 cjep_staticlib_x-base1:1.1.1.13 netbsd-9-2-RELEASE:1.1.1.7 cjep_staticlib_x:1.1.1.13.0.2 cjep_staticlib_x-base:1.1.1.13 gcc-10-3-0:1.1.1.13 netbsd-9-1-RELEASE:1.1.1.7 gcc-9-3-0:1.1.1.12 gcc-7-5-0:1.1.1.10 phil-wifi-20200421:1.1.1.9 phil-wifi-20200411:1.1.1.9 is-mlppp:1.1.1.8.0.2 is-mlppp-base:1.1.1.8 phil-wifi-20200406:1.1.1.9 netbsd-8-2-RELEASE:1.1.1.4 gcc-8-4-0:1.1.1.11 netbsd-9-0-RELEASE:1.1.1.7 netbsd-9-0-RC2:1.1.1.7 netbsd-9-0-RC1:1.1.1.7 phil-wifi-20191119:1.1.1.8 gcc-8-3-0:1.1.1.8 netbsd-9:1.1.1.7.0.2 netbsd-9-base:1.1.1.7 phil-wifi-20190609:1.1.1.7 netbsd-8-1-RELEASE:1.1.1.4 netbsd-8-1-RC1:1.1.1.4 pgoyette-compat-merge-20190127:1.1.1.5.2.2 pgoyette-compat-20190127:1.1.1.7 gcc-7-4-0:1.1.1.7 pgoyette-compat-20190118:1.1.1.6 pgoyette-compat-1226:1.1.1.6 pgoyette-compat-1126:1.1.1.6 gcc-6-5-0:1.1.1.6 pgoyette-compat-1020:1.1.1.5 pgoyette-compat-0930:1.1.1.5 pgoyette-compat-0906:1.1.1.5 netbsd-7-2-RELEASE:1.1.1.2 pgoyette-compat-0728:1.1.1.5 netbsd-8-0-RELEASE:1.1.1.4 phil-wifi:1.1.1.5.0.4 phil-wifi-base:1.1.1.5 pgoyette-compat-0625:1.1.1.5 netbsd-8-0-RC2:1.1.1.4 pgoyette-compat-0521:1.1.1.5 pgoyette-compat-0502:1.1.1.5 pgoyette-compat-0422:1.1.1.5 netbsd-8-0-RC1:1.1.1.4 pgoyette-compat-0415:1.1.1.5 pgoyette-compat-0407:1.1.1.5 pgoyette-compat-0330:1.1.1.5 pgoyette-compat-0322:1.1.1.5 pgoyette-compat-0315:1.1.1.5 netbsd-7-1-2-RELEASE:1.1.1.2 pgoyette-compat:1.1.1.5.0.2 pgoyette-compat-base:1.1.1.5 gcc-6-4-0:1.1.1.5 netbsd-7-1-1-RELEASE:1.1.1.2 gcc-5-5-0:1.1.1.4 matt-nb8-mediatek:1.1.1.4.0.12 matt-nb8-mediatek-base:1.1.1.4 perseant-stdc-iso10646:1.1.1.4.0.10 perseant-stdc-iso10646-base:1.1.1.4 netbsd-8:1.1.1.4.0.8 netbsd-8-base:1.1.1.4 prg-localcount2-base3:1.1.1.4 prg-localcount2-base2:1.1.1.4 prg-localcount2-base1:1.1.1.4 prg-localcount2:1.1.1.4.0.6 prg-localcount2-base:1.1.1.4 pgoyette-localcount-20170426:1.1.1.4 bouyer-socketcan-base1:1.1.1.4 pgoyette-localcount-20170320:1.1.1.4 netbsd-7-1:1.1.1.2.0.10 netbsd-7-1-RELEASE:1.1.1.2 netbsd-7-1-RC2:1.1.1.2 netbsd-7-nhusb-base-20170116:1.1.1.2 bouyer-socketcan:1.1.1.4.0.4 bouyer-socketcan-base:1.1.1.4 pgoyette-localcount-20170107:1.1.1.4 netbsd-7-1-RC1:1.1.1.2 pgoyette-localcount-20161104:1.1.1.4 netbsd-7-0-2-RELEASE:1.1.1.2 localcount-20160914:1.1.1.4 netbsd-7-nhusb:1.1.1.2.0.8 netbsd-7-nhusb-base:1.1.1.2 pgoyette-localcount-20160806:1.1.1.4 pgoyette-localcount-20160726:1.1.1.4 pgoyette-localcount:1.1.1.4.0.2 pgoyette-localcount-base:1.1.1.4 gcc-5-4-0:1.1.1.4 netbsd-7-0-1-RELEASE:1.1.1.2 gcc-5-3-0:1.1.1.3 netbsd-7-0:1.1.1.2.0.6 netbsd-7-0-RELEASE:1.1.1.2 gcc-4-8-5-pre-gcc-old-import:1.1.1.2 netbsd-7-0-RC3:1.1.1.2 netbsd-7-0-RC2:1.1.1.2 post-gcc-4-8-5-merge:1.1.1.2 gcc-4-8-5:1.1.1.2 netbsd-7-0-RC1:1.1.1.2 gcc-4-8-4:1.1.1.2 gcc-4-8-20141009:1.1.1.2 netbsd-6-0-6-RELEASE:1.1.1.1 netbsd-6-1-5-RELEASE:1.1.1.1 netbsd-7:1.1.1.2.0.4 netbsd-7-base:1.1.1.2 gcc-4-8-3:1.1.1.2 yamt-pagecache-base9:1.1.1.2 yamt-pagecache-tag8:1.1.1.1 netbsd-6-1-4-RELEASE:1.1.1.1 netbsd-6-0-5-RELEASE:1.1.1.1 tls-earlyentropy:1.1.1.2.0.2 tls-earlyentropy-base:1.1.1.2 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2 riastradh-drm2-base3:1.1.1.2 gcc-4-8-3-pre-r208254:1.1.1.2 gcc-4-8-3-pre-r206687:1.1.1.2 imported-to-gcc-old-20140227-0107:1.1.1.1 netbsd-6-1-3-RELEASE:1.1.1.1 netbsd-6-0-4-RELEASE:1.1.1.1 netbsd-6-1-2-RELEASE:1.1.1.1 netbsd-6-0-3-RELEASE:1.1.1.1 netbsd-6-1-1-RELEASE:1.1.1.1 riastradh-drm2-base2:1.1.1.1 riastradh-drm2-base1:1.1.1.1 riastradh-drm2:1.1.1.1.0.12 riastradh-drm2-base:1.1.1.1 netbsd-6-1:1.1.1.1.0.16 netbsd-6-0-2-RELEASE:1.1.1.1 netbsd-6-1-RELEASE:1.1.1.1 netbsd-6-1-RC4:1.1.1.1 netbsd-6-1-RC3:1.1.1.1 agc-symver:1.1.1.1.0.14 agc-symver-base:1.1.1.1 netbsd-6-1-RC2:1.1.1.1 netbsd-6-1-RC1:1.1.1.1 yamt-pagecache-base8:1.1.1.1 netbsd-6-0-1-RELEASE:1.1.1.1 yamt-pagecache-base7:1.1.1.1 matt-nb6-plus-nbase:1.1.1.1 yamt-pagecache-base6:1.1.1.1 netbsd-6-0:1.1.1.1.0.10 netbsd-6-0-RELEASE:1.1.1.1 gcc-4-5-4:1.1.1.1 netbsd-6-0-RC2:1.1.1.1 tls-maxphys:1.1.1.1.0.8 tls-maxphys-base:1.1.1.2 matt-nb6-plus:1.1.1.1.0.6 matt-nb6-plus-base:1.1.1.1 netbsd-6-0-RC1:1.1.1.1 yamt-pagecache-base5:1.1.1.1 yamt-pagecache-base4:1.1.1.1 netbsd-6:1.1.1.1.0.4 netbsd-6-base:1.1.1.1 yamt-pagecache-base3:1.1.1.1 yamt-pagecache-base2:1.1.1.1 yamt-pagecache:1.1.1.1.0.2 yamt-pagecache-base:1.1.1.1 gcc-4-5-3:1.1.1.1 FSF:1.1.1; locks; strict; comment @# @; 1.1 date 2011.06.21.01.24.06; author mrg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2011.06.21.01.24.06; author mrg; state Exp; branches 1.1.1.1.2.1 1.1.1.1.8.1; next 1.1.1.2; 1.1.1.2 date 2014.03.01.08.41.29; author mrg; state Exp; branches; next 1.1.1.3; commitid TtaB91QNTknAoYqx; 1.1.1.3 date 2016.01.24.06.05.43; author mrg; state Exp; branches; next 1.1.1.4; commitid uWWfbLp08zOK79Sy; 1.1.1.4 date 2016.06.07.05.57.45; author mrg; state Exp; branches; next 1.1.1.5; commitid KKgo7HPiSHWAPu9z; 1.1.1.5 date 2018.02.02.01.59.03; author mrg; state Exp; branches 1.1.1.5.2.1 1.1.1.5.4.1; next 1.1.1.6; commitid XNKaycqpfhzd5epA; 1.1.1.6 date 2018.11.04.00.12.37; author mrg; state Exp; branches; next 1.1.1.7; commitid bulspy67pMB6EyYA; 1.1.1.7 date 2019.01.19.10.14.11; author mrg; state Exp; branches; next 1.1.1.8; commitid VQ8OwWIg5RS9kn8B; 1.1.1.8 date 2019.10.01.09.36.13; author mrg; state Exp; branches; next 1.1.1.9; commitid smvgr2IPAQDr89FB; 1.1.1.9 date 2020.03.11.08.15.58; author mrg; state Exp; branches; next 1.1.1.10; commitid AhKhCnGPUZgytXZB; 1.1.1.10 date 2020.08.11.05.10.39; author mrg; state Exp; branches; next 1.1.1.11; commitid 5dBRDT7i6e65xBjC; 1.1.1.11 date 2020.08.11.05.30.16; author mrg; state Exp; branches; next 1.1.1.12; commitid 7AI4OfpLi4eqEBjC; 1.1.1.12 date 2020.09.05.07.52.18; author mrg; state Exp; branches; next 1.1.1.13; commitid ZRYA7IOuwfMjAPmC; 1.1.1.13 date 2021.04.10.22.10.05; author mrg; state Exp; branches; next 1.1.1.14; commitid eC4g0MRpqTvEkNOC; 1.1.1.14 date 2023.07.30.05.21.21; author mrg; state Exp; branches 1.1.1.14.2.1; next 1.1.1.15; commitid tk6nV4mbc9nVEMyE; 1.1.1.15 date 2024.06.30.07.35.47; author mrg; state Exp; branches; next 1.1.1.16; commitid m7BwZsPdfJvuHYfF; 1.1.1.16 date 2025.09.13.23.45.49; author mrg; state Exp; branches; next ; commitid KwhwN4krNWa6XBaG; 1.1.1.1.2.1 date 2014.05.22.16.37.45; author yamt; state Exp; branches; next ; commitid DX8bafDLmqEbpyBx; 1.1.1.1.8.1 date 2014.08.19.23.54.46; author tls; state Exp; branches; next ; commitid jTnpym9Qu0o4R1Nx; 1.1.1.5.2.1 date 2018.11.26.01.50.57; author pgoyette; state Exp; branches; next 1.1.1.5.2.2; commitid Zj4q5SspGdKXto1B; 1.1.1.5.2.2 date 2019.01.26.21.59.32; author pgoyette; state Exp; branches; next ; commitid JKpcmvSjdT25dl9B; 1.1.1.5.4.1 date 2019.06.10.21.54.49; author christos; state Exp; branches; next 1.1.1.5.4.2; commitid jtc8rnCzWiEEHGqB; 1.1.1.5.4.2 date 2020.04.08.14.06.37; author martin; state Exp; branches; next 1.1.1.5.4.3; commitid Qli2aW9E74UFuA3C; 1.1.1.5.4.3 date 2020.04.13.07.58.34; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; 1.1.1.14.2.1 date 2024.07.01.01.00.57; author perseant; state Exp; branches; next ; commitid NkoYLLCQWWw9v4gF; desc @@ 1.1 log @Initial revision @ text @ Chapter 3. Using

Chapter 3. Using

Table of Contents

Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis

Command Options

The set of features available in the GNU C++ library is shaped by several GCC Command Options. Options that impact libstdc++ are enumerated and detailed in the table below.

By default, g++ is equivalent to g++ -std=gnu++98. The standard library also defaults to this dialect.

Table 3.1. C++ Command Options

Option FlagsDescription
-std=c++98Use the 1998 ISO C++ standard plus amendments.
-std=gnu++98As directly above, with GNU extensions.
-std=c++0xUse the working draft of the upcoming ISO C++0x standard.
-std=gnu++0xAs directly above, with GNU extensions.
-fexceptionsSee exception-free dialect
-frttiAs above, but RTTI-free dialect.
-pthread or -pthreadsFor ISO C++0x <thread>, <future>, <mutex>, or <condition_variable>.
-fopenmpFor parallel mode.

@ 1.1.1.1 log @initial import of GCC 4.5.3 sources. changes since 4.1 are way too numerous to review, please see http://gcc.gnu.org/gcc-4.5/changes.html (and the 4.2, 4.3 and 4.4 versions, too.) this includes the core, c++, objc and the non java/ada/fortran parts of the testsuite. @ text @@ 1.1.1.1.8.1 log @Rebase to HEAD as of a few days ago. @ text @d2 2 a3 1 Chapter 3. Using

Chapter 3. Using

Table of Contents

Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Structure
Defaults
Future
Alternatives
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
With C
With POSIX thread cancellation
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Data Race Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis

Command Options

d9 1 a9 1 several GCC d14 2 a15 2

Table 3.1. C++ Command Options

Option FlagsDescription
-std=c++98Use the 1998 ISO C++ standard plus amendments.
-std=gnu++98As directly above, with GNU extensions.
-std=c++11Use the 2011 ISO C++ standard.
-std=gnu++11As directly above, with GNU extensions.
-fexceptionsSee exception-free dialect
-frttiAs above, but RTTI-free dialect.
-pthread or -pthreadsFor ISO C++11 <thread>, <future>, <mutex>, or <condition_variable>.
-fopenmpFor parallel mode.

@ 1.1.1.1.2.1 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d2 2 a3 1 Chapter 3. Using

Chapter 3. Using

Table of Contents

Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Structure
Defaults
Future
Alternatives
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
With C
With POSIX thread cancellation
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Data Race Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis

Command Options

d9 1 a9 1 several GCC d14 2 a15 2

Table 3.1. C++ Command Options

Option FlagsDescription
-std=c++98Use the 1998 ISO C++ standard plus amendments.
-std=gnu++98As directly above, with GNU extensions.
-std=c++11Use the 2011 ISO C++ standard.
-std=gnu++11As directly above, with GNU extensions.
-fexceptionsSee exception-free dialect
-frttiAs above, but RTTI-free dialect.
-pthread or -pthreadsFor ISO C++11 <thread>, <future>, <mutex>, or <condition_variable>.
-fopenmpFor parallel mode.

@ 1.1.1.2 log @import GCC 4.8 branch at r206687. highlights from: http://gcc.gnu.org/gcc-4.6/changes.html GCC now has stricter checks for invalid command-line options New -Wunused-but-set-variable and -Wunused-but-set-parameter warnings Many platforms have been obsoleted Link-time optimization improvements A new switch -fstack-usage has been added A new function attribute leaf was introduced A new warning, enabled by -Wdouble-promotion Support for selectively enabling and disabling warnings via #pragma GCC diagnostic has been added There is now experimental support for some features from the upcoming C1X revision of the ISO C standard Improved experimental support for the upcoming C++0x ISO C++ standard G++ now issues clearer diagnostics in several cases Updates for ARM, x86, MIPS, PPC/PPC64, SPARC Darwin, FreeBSD, Solaris 2, MinGW and Cygwin now all support __float128 on 32-bit and 64-bit x86 targets. [*1] highlights from: http://gcc.gnu.org/gcc-4.7/changes.html The -fconserve-space flag has been deprecated Support for a new parameter --param case-values-threshold=n was added Interprocedural and Link-time optimization improvements A new built-in, __builtin_assume_aligned, has been added A new warning option -Wunused-local-typedefs was added A new experimental command-line option -ftrack-macro-expansion was added Support for atomic operations specifying the C++11/C11 memory model has been added There is support for some more features from the C11 revision of the ISO C standard Improved experimental support for the new ISO C++ standard, C++11 Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE* A new option (-grecord-gcc-switches) was added highlights from: http://gcc.gnu.org/gcc-4.8/changes.html GCC now uses C++ as its implementation language. This means that to build GCC from sources, you will need a C++ compiler that understands C++ 2003 DWARF4 is now the default when generating DWARF debug information A new general optimization level, -Og, has been introduced A new option -ftree-partial-pre was added The option -fconserve-space has been removed The command-line options -fipa-struct-reorg and -fipa-matrix-reorg have been removed Interprocedural and Link-time optimization improvements AddressSanitizer, a fast memory error detector, has been added [*2] A new -Wsizeof-pointer-memaccess warning has been added G++ now supports a -std=c++1y option for experimentation with features proposed for the next revision of the standard, expected around 2014 Improved experimental support for the new ISO C++ standard, C++11 A new port has been added to support AArch64 Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE* [*1] we should support this too! [*2] we should look into this. https://code.google.com/p/address-sanitizer/ @ text @d2 2 a3 1 Chapter 3. Using

Chapter 3. Using

Table of Contents

Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Structure
Defaults
Future
Alternatives
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
With C
With POSIX thread cancellation
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Data Race Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis

Command Options

d9 1 a9 1 several GCC d14 2 a15 2

Table 3.1. C++ Command Options

Option FlagsDescription
-std=c++98Use the 1998 ISO C++ standard plus amendments.
-std=gnu++98As directly above, with GNU extensions.
-std=c++11Use the 2011 ISO C++ standard.
-std=gnu++11As directly above, with GNU extensions.
-fexceptionsSee exception-free dialect
-frttiAs above, but RTTI-free dialect.
-pthread or -pthreadsFor ISO C++11 <thread>, <future>, <mutex>, or <condition_variable>.
-fopenmpFor parallel mode.

@ 1.1.1.3 log @import GCC 5.3.0. see these urls for details which are too large to include here: http://gcc.gnu.org/gcc-4.9/changes.html http://gcc.gnu.org/gcc-5/changes.html (note that GCC 5.x is a release stream like GCC 4.9.x, 4.8.x, etc.) the main issues we will have are: The default mode for C is now -std=gnu11 instead of -std=gnu89. ARM: The deprecated option -mwords-little-endian has been removed. The options -mapcs, -mapcs-frame, -mtpcs-frame and -mtpcs-leaf-frame which are only applicable to the old ABI have been deprecated. MIPS: The o32 ABI has been modified and extended. The o32 64-bit floating-point register support is now obsolete and has been removed. It has been replaced by three ABI extensions FPXX, FP64A, and FP64. The meaning of the -mfp64 command-line option has changed. It is now used to enable the FP64A and FP64 ABI extensions. @ text @d5 3 a7 2  Next

Chapter 3. Using

Table of Contents

Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Dual ABI
Troubleshooting
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Structure
Defaults
Future
Alternatives
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
With C
With POSIX thread cancellation
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Data Race Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis

Command Options

The set of features available in the GNU C++ library is shaped by d13 2 a14 9

Table 3.1. C++ Command Options

Option FlagsDescription
-std=c++98Use the 1998 ISO C++ standard plus amendments.
-std=gnu++98As directly above, with GNU extensions.
-std=c++11Use the 2011 ISO C++ standard.
-std=gnu++11As directly above, with GNU extensions.
-fexceptionsSee exception-free dialect
-frttiAs above, but RTTI-free dialect.
-pthread or -pthreadsFor ISO C++11 <thread>, <future>, <mutex>, or <condition_variable>.
-latomicLinking to libatomic is required for some uses of ISO C++11 <atomic>.
-fopenmpFor parallel mode.

@ 1.1.1.4 log @import GCC 5.4.0 release. there's not a lot of new info though at least these 135 (!) GCC PRs have been fixed by the update: 68730 69714 67550 70209 71254 70839 69737 70067 67355 67172 69239 65779 69546 70272 70421 65985 67339 67411 68309 68585 68679 68890 68949 69009 70139 70494 68162 69135 70306 68965 70297 70635 66786 69098 70347 69719 70526 70941 69400 69577 69447 65689 65886 65932 66655 68269 68789 69614 69648 69666 69764 69794 70044 70052 65726 68910 64289 68671 68835 69669 70329 71204 69355 67364 68049 68998 69323 69743 69995 69146 68651 67755 67484 68790 68907 69099 69496 69509 69516 70393 69222 69703 69939 70609 71004 71005 71036 71037 71038 68636 69013 69606 70115 70333 70430 60290 70356 69305 70024 67781 69414 69140 70510 60164 66635 67896 68106 68298 68449 68779 68921 68986 69037 69147 69194 69366 69399 69705 69917 69969 70613 71317 69268 70269 69032 65702 69219 69484 65996 66680 68283 69603 70350 67451 61397 @ text @d5 1 a5 1  Next

Chapter 3. Using

Table of Contents

Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Dual ABI
Troubleshooting
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Experimental Library Extensions
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Structure
Defaults
Future
Alternatives
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
With C
With POSIX thread cancellation
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Data Race Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis

Command Options

d11 2 a12 7 The standard library conforms to the dialect of C++ specified by the -std option passed to the compiler. By default, g++ is equivalent to g++ -std=gnu++98 for GCC 5 and older releases.

Table 3.1. C++ Command Options

Option FlagsDescription
-std=c++98 or -std=c++03 Use the 1998 ISO C++ standard plus amendments.
-std=gnu++98 or -std=gnu++03 As directly above, with GNU extensions.
-std=c++11Use the 2011 ISO C++ standard.
-std=gnu++11As directly above, with GNU extensions.
-std=c++14Use the 2014 ISO C++ standard.
-std=gnu++14As directly above, with GNU extensions.
-fexceptionsSee exception-free dialect
-frttiAs above, but RTTI-free dialect.
-pthread or -pthreadsFor ISO C++11 a19 3
-lstdc++fsLinking to libstdc++fs is required for use of the Filesystem library extensions in <experimental/filesystem>. @ 1.1.1.5 log @import GCC 6.4.0. see this url for details which are too large to include here: http://gcc.gnu.org/gcc-6/changes.html the main visible changes appear to be: - The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98. - The C and C++ compilers now support attributes on enumerators. - Diagnostics can now contain "fix-it hints" - more warnings (some added to -Wall) @ text @d14 1 a14 2 g++ -std=gnu++14 since GCC 6, and g++ -std=gnu++98 for older releases. @ 1.1.1.5.4.1 log @Sync with HEAD @ text @d2 1 a2 1 Chapter 3. Using

Chapter 3. Using

Command Options

@ 1.1.1.14 log @initial import of GCC 12.3.0. major changes in GCC 11 included: - The default mode for C++ is now -std=gnu++17 instead of -std=gnu++14. - When building GCC itself, the host compiler must now support C++11, rather than C++98. - Some short options of the gcov tool have been renamed: -i to -j and -j to -H. - ThreadSanitizer improvements. - Introduce Hardware-assisted AddressSanitizer support. - For targets that produce DWARF debugging information GCC now defaults to DWARF version 5. This can produce up to 25% more compact debug information compared to earlier versions. - Many optimisations. - The existing malloc attribute has been extended so that it can be used to identify allocator/deallocator API pairs. A pair of new -Wmismatched-dealloc and -Wmismatched-new-delete warnings are added. - Other new warnings: -Wsizeof-array-div, enabled by -Wall, warns about divisions of two sizeof operators when the first one is applied to an array and the divisor does not equal the size of the array element. -Wstringop-overread, enabled by default, warns about calls to string functions reading past the end of the arrays passed to them as arguments. -Wtsan, enabled by default, warns about unsupported features in ThreadSanitizer (currently std::atomic_thread_fence). - Enchanced warnings: -Wfree-nonheap-object detects many more instances of calls to deallocation functions with pointers not returned from a dynamic memory allocation function. -Wmaybe-uninitialized diagnoses passing pointers or references to uninitialized memory to functions taking const-qualified arguments. -Wuninitialized detects reads from uninitialized dynamically allocated memory. -Warray-parameter warns about functions with inconsistent array forms. -Wvla-parameter warns about functions with inconsistent VLA forms. - Several new features from the upcoming C2X revision of the ISO C standard are supported with -std=c2x and -std=gnu2x. - Several C++20 features have been implemented. - The C++ front end has experimental support for some of the upcoming C++23 draft. - Several new C++ warnings. - Enhanced Arm, AArch64, x86, and RISC-V CPU support. - The implementation of how program state is tracked within -fanalyzer has been completely rewritten with many enhancements. see https://gcc.gnu.org/gcc-11/changes.html for a full list. major changes in GCC 12 include: - An ABI incompatibility between C and C++ when passing or returning by value certain aggregates containing zero width bit-fields has been discovered on various targets. x86-64, ARM and AArch64 will always ignore them (so there is a C ABI incompatibility between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2 always take them into account (so there is a C++ ABI incompatibility, GCC 4.4 and earlier compatible with GCC 12 or later, incompatible with GCC 4.5 through GCC 11). RISC-V has changed the handling of these already starting with GCC 10. As the ABI requires, MIPS takes them into account handling function return values so there is a C++ ABI incompatibility with GCC 4.5 through 11. - STABS: Support for emitting the STABS debugging format is deprecated and will be removed in the next release. All ports now default to emit DWARF (version 2 or later) debugging info or are obsoleted. - Vectorization is enabled at -O2 which is now equivalent to the original -O2 -ftree-vectorize -fvect-cost-model=very-cheap. - GCC now supports the ShadowCallStack sanitizer. - Support for __builtin_shufflevector compatible with the clang language extension was added. - Support for attribute unavailable was added. - Support for __builtin_dynamic_object_size compatible with the clang language extension was added. - New warnings: -Wbidi-chars warns about potentially misleading UTF-8 bidirectional control characters. -Warray-compare warns about comparisons between two operands of array type. - Some new features from the upcoming C2X revision of the ISO C standard are supported with -std=c2x and -std=gnu2x. - Several C++23 features have been implemented. - Many C++ enhancements across warnings and -f options. see https://gcc.gnu.org/gcc-12/changes.html for a full list. @ text @d14 1 a14 2 g++ -std=gnu++17 since GCC 11, and g++ -std=gnu++14 in GCC 6, 7, 8, 9, and 10, and d18 1 a18 5

As directly above, with GNU extensions.
-std=c++11Use the 2011 ISO C++ standard.
-std=gnu++11As directly above, with GNU extensions.
-std=c++14Use the 2014 ISO C++ standard.
-std=gnu++14As directly above, with GNU extensions.
-fno-exceptions See exception-free dialect
-fno-rtti As above, but RTTI-free dialect.
-pthreadFor ISO C++11 a28 6
-lstdc++_libbacktraceUntil C++23 support is non-experimental, linking to libstdc++_libbacktrace.a is required for use of the C++23 type std::stacktrace and related types in <stacktrace>. @ 1.1.1.14.2.1 log @Sync with HEAD. @ text @d7 1 a7 1 several GCC d17 3 a19 5

Table 3.1. C++ Command Options

Option FlagsDescription
-std Select the C++ standard, and whether to use the base standard or GNU dialect.
@ 1.1.1.15 log @import GCC 12.4.0. this includes at least 85 GCC PRs fixed, 2 C, 17 C++, 16 libstdc++-v3, at least 13 target-specific (x86, arm64, riscv mostly), and at least 24 optimisation PRs. @ text @d7 1 a7 1 several GCC d17 3 a19 5

Table 3.1. C++ Command Options

Option FlagsDescription
-std Select the C++ standard, and whether to use the base standard or GNU dialect.
@ 1.1.1.16 log @initial import of GCC 14.3.0. major changes in GCC 13: - improved sanitizer - zstd debug info compression - LTO improvements - SARIF based diagnostic support - new warnings: -Wxor-used-as-pow, -Wenum-int-mismatch, -Wself-move, -Wdangling-reference - many new -Wanalyzer* specific warnings - enhanced warnings: -Wpessimizing-move, -Wredundant-move - new attributes to mark file descriptors, c++23 "assume" - several C23 features added - several C++23 features added - many new features for Arm, x86, RISC-V major changes in GCC 14: - more strict C99 or newer support - ia64* marked deprecated (but seemingly still in GCC 15.) - several new hardening features - support for "hardbool", which can have user supplied values of true/false - explicit support for stack scrubbing upon function exit - better auto-vectorisation support - added clang-compatible __has_feature and __has_extension - more C23, including -std=c23 - several C++26 features added - better diagnostics in C++ templates - new warnings: -Wnrvo, Welaborated-enum-base - many new features for Arm, x86, RISC-V - possible ABI breaking change for SPARC64 and small structures with arrays of floats. @ text @d5 1 a5 1  Next

-lstdc++expLinking to libstdc++exp.a is required for use of experimental C++ library features. This currently provides support for the C++23 types defined in the <stacktrace> header, the Filesystem library extensions defined in the <experimental/filesystem> header, and the Contracts extensions enabled by -fcontracts.
-lstdc++fsLinking to libstdc++fs.a is another way to use the Filesystem library extensions defined in the <experimental/filesystem> header. The libstdc++exp.a library also provides all the symbols contained in this library. a44 6
-ffreestanding Limits the library to its freestanding subset. Headers that are not supported in freestanding will emit a "This header is not available in freestanding mode" error. Headers that are in the freestanding subset partially will not expose functionality that is not part of the freestanding subset. @