HomeFreeBSD

src: Use gnu17 as the default C standard for userland instead of gnu99

Description

src: Use gnu17 as the default C standard for userland instead of gnu99

Tracking newer versions of C (and C++) permits assuming newer language
features in the base system. Some C11 extensions are already used in
the base system but implemented on top of GNU C extensions such as
_Alignas and _Static_assert. In some cases the fallback versions in
cdefs.h are more limited than the native C11 extensions.

Even though C11 is the next major version of C, C17 is chosen instead
since C17 does not add new features to C but merely fixes defects in
C11. It is also well supported by a wide range of clang (7.0.0+) and
GCC (8.1+) versions.

Along with changing the default, this change also removes explicit
requests for c11 via the CSTD variable in various Makefiles.

Libraries and binaries for ZFS continue to use c99.

PR: 284039 (exp-run)
Reviewed by: imp, arichardson, emaste
Differential Revision: https://reviews.freebsd.org/D43237

Details

Provenance
minsoochoo0122_proton.meAuthored on Jan 9 2025, 4:13 PM
jhbCommitted on Tue, Feb 11, 2:16 PM
Reviewer
imp
Differential Revision
D43237: Use gnu17 for buildworld
Parents
rGd35b039af944: gpart: Stop documenting freebsd-vinum partition types
Branches
Unknown
Tags
Unknown