GNU: Incorrect flag for C23
In CMake 3.21.0 the generated flag for C23 seems incorrect for GCC: https://gitlab.kitware.com/cmake/cmake/-/blob/b9c3acac02b6202359e6964853521878e386ed06/Modules/Compiler/GNU-C.cmake#L45
It generates -std=gnu23
instead of -std=gnu2x
. Neither GCC trunk, nor GCC 9.1 as mentioned in !5783 (b658ef18), seem to work with -std=gnu23
: https://godbolt.org/z/7zbo5rjfa
Note: for clang it works: https://gitlab.kitware.com/cmake/cmake/-/blob/b9c3acac02b6202359e6964853521878e386ed06/Modules/Compiler/Clang-C.cmake#L51
Edited by Brad King