BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News GCC 4.8 Completes Move to C++

GCC 4.8 Completes Move to C++

This item in japanese

The latest version of the GNU Compiler Collection (GCC) has been released which marks completion of its conversion to C++. This process been a multi-year project, with the GCC team stating that this move was needed to retain and attract new project members through a maintainable code base. C++ was chosen in part as it is a standards-based language that according to the project "supports cleaner code, makes it easier to write and enforce cleaner interfaces... and is not a panacea but it is an improvement [over the C-based legacy code].” The end-result for most developers is only that those interested in compiling 4.8 from source must use a compiler that understands C++ 2003.  Typical users will simply benefit from a compiler suite that is designed to be more efficient and easier to update.

New Compiler Features

General compiler improvements include a "new general optimization level [that] has been introduced. It addresses the need for fast compilation and a superior debugging experience while providing a reasonable level of runtime performance.” Additionally, 4.8 includes the AddressSanitizer for memory error detection and the ThreadSanitizer which allows instructions [to] be instrumented to detect data races. (The ThreadSanitizer is currently exclusively available on x86-64 GNU/Linux.)

Notable new compiler targets include 64-bit ARM (AArch64), and 32-bit ARMv8 architecture.

Language Specific Improvements

Completing the switch to C++ is not the only notable accomplishment of this release. Several areas of the compiler received improvements. GCC now supports the preliminary version of Go 1.1 for GNU/Linux and Solaris on multiple architectures. Fortran and C also received several updates worth investigating if developing in those languages.

C++ users will find improved C++11 support:

  • thread_local keyword
  • attribute syntax
  • alignment specifier
  • inheriting constructors
  • forward_list meets the allocator-aware container requirements

C++11 support in GCC 4.8 compares very favorably to the Clang 3.2, and both of these compilers have pulled ahead of the latest support in Visual Studio 2012's November CTP. Planning for future C++ changes has begun with the addition of the option -std=c++1y for experimentation with features proposed for the next major revision of the standard, expected around 2017.

The C++ runtime standard library (libstdc++) has greater support for C++11, improvements in random number generation (including hardware support on new X86 processors), and new random number distributions.

Rate this Article

Adoption
Style

BT