The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=079d67b1d8618f1bc02b6507d7ee934529818a49

commit 079d67b1d8618f1bc02b6507d7ee934529818a49
Author:     Minsoo Choo <minsoochoo0...@proton.me>
AuthorDate: 2024-06-03 14:58:18 +0000
Commit:     Warner Losh <i...@freebsd.org>
CommitDate: 2024-06-03 14:58:18 +0000

    sys: Disable C standards prior to C99 from kernel build
    
    The kernel hasn't built with anything less than c99 for a long
    time. Retire support in the build for it.  In addition, retire the
    translation of c99 to -std=iso9899:1999, since all latter day C
    compilers that we support have had this for maybe 15 years or so (gcc
    since 4.5, clang since the earliest version) and it simplifies the code.
    
    Reviewed-by: imp, emaste
    Differential-Revision: https://reviews.freebsd.org/D44145
---
 sys/conf/kern.mk | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 5cd3a43f01b8..d51aa1f1dfa9 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -284,14 +284,10 @@ PHONY_NOTMAIN = afterdepend afterinstall all beforedepend 
beforeinstall \
 
 CSTD?=         gnu99
 
-.if ${CSTD} == "k&r"
-CFLAGS+=        -traditional
-.elif ${CSTD} == "c89" || ${CSTD} == "c90"
-CFLAGS+=        -std=iso9899:1990
-.elif ${CSTD} == "c94" || ${CSTD} == "c95"
-CFLAGS+=        -std=iso9899:199409
-.elif ${CSTD} == "c99"
-CFLAGS+=        -std=iso9899:1999
+# c99/gnu99 is the minimum C standard version supported for kernel build
+.if ${CSTD} == "k&r" || ${CSTD} == "c89" || ${CSTD} == "c90" || \
+    ${CSTD} == "c94" || ${CSTD} == "c95"
+.error "Only c99/gnu99 or later is supported"
 .else # CSTD
 CFLAGS+=        -std=${CSTD}
 .endif # CSTD

Reply via email to