GCC 9 Compiler Adds -std=c2x And -std=gnu2x For Future C Language Update
Written by Michael Larabel in GNU on 18 October 2018 at 04:58 AM EDT. 5 Comments
GNU --
With GCC 9 feature development ending in a few weeks, it's now a mad dash by developers to land their last minute additions into this annual open-source compiler update -- including a look ahead for what is coming down the pipe in the compiler space.

Joseph Myers of CodeSourcery landed on Wednesday the initial C language standard compiler switches for the upcoming C2X standard. This update that for now is just dubbed C2X is currently in a draft standard with feature development still happening for this next C programming language update. In preparing for that, to GCC 9 he has added support for the -std=c2x and -std=gnu2x (for the GNU C dialect of C2X) switches so developers can specify using this newer version of C.

Granted, for what will be found in the GCC 9.1 stable release due out early next year is very limited, but the switch will obviously come in handy moving forward as support for more C2X features get added to the compiler. The C2X standard isn't expected to be voted on and published until 2021 at the very earliest but more than likely 2022 is when it will officially see the light of day as the successor to C17... So likely GCC 12.1 is when everything may be fully baked.

With the addition of the new -std=c2x / -std=gnu2x switches, the first C2X language feature is also added to the GCC codebase: support for string constants to be omitted within _Static_assert. The C2X _Static_assert support can also be used as an extension for use with earlier versions of C.

Among the discussions at this stage for C2X have included a fundamental type for short floats (half-precision floating point), new array types and bounds checking, a better means for breaking out of multiple nested loops, better parallelism capabilities baked into C itself, better harmonization with C++, and more.
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Related GNU News
Popular News This Week