GCC 9 Compiler Adds -std=c2x And -std=gnu2x For Future C Language Update

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.
5 Comments