This is part 2 of adopting C17, therefore migrating to gnu17 from gnu99. This depends on D43237
Why?
There are many reasons, but some prominent reasons are
- Facilitating the adoption of C23/C2x. This is likely to be finalized in 2024, and clang has already implemented most of C2x features. Migrating from C17 to C2x will be easier than migrating from C99 to C2x.
- C11 has adopted GCC specific features as a part of standard, such as _Alignas. However, _Alignof cannot be used in an expression according to standard C23
- Allowing programs to use C11 features without specifying CSTD= c17 or similar.
This revision does
- Change default C standard version for buildkernel to gnu17
- Replace _Alignof with __alignof__ to avoid error: '_Alignof' applied to an expression is a GNU extension