From nobody Tue Feb 11 14:17:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ysk795Zmqz5ndm0; Tue, 11 Feb 2025 14:17:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ysk794sNQz4MBy; Tue, 11 Feb 2025 14:17:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739283477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9kkZlSFmtFpoeXzkTMUQQXs1aaiTbcEmAKVe0Okpi6s=; b=LyqtByNIIf4LTJbLbl2ICkpVSZKGy8W0k3EfWSZJ2mf1iwvag4YuNKBIPZewadRRhlWCUw BpnjhHdkRjCMPw2J+C4j+zLdtJ1CZYkLSiHAfFxS8HPZ54YBveq1ACLqQeuoz3jZmkfrmr 6jt8aQtYjPvCxy/WmPNpnx96N2EYT2kyhICNyAdfH2bSee2On5I9dID4hDDEJ0NNbYCKAM F2edKo1f7Y5yIidDN/lw1WWoAaX9OrrtXDaIv/VFI1K81S+2NnHsICBqpkv62s/Vs2lWzA DS0EgZAXj19UwBETbFf2DPXzOue/IHsKpK2u1qv3TY8DyQ7CX2JXINgYI461DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739283477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9kkZlSFmtFpoeXzkTMUQQXs1aaiTbcEmAKVe0Okpi6s=; b=toBE6riQ5kTEnz900NaXpluwp5eTwmqGNcCN5qhDn+6NE3YlufiW19/mZO7YsCDic4j1iw Q1c/E1VOwfk9pJF4aL1q2q7G3xCEoQYbOOu1zGubtwOs5f4wey5VbM42Apws55e9+ds4Ut 6xr7Xku3pTf93qHHkN69mMGdYOHYpkXXSOT9tsuiLe/K7hTJLt7L8u6dtStdKyJi5MZmQF LgNJnnAh4BaotKFGTs+eWHSRCJyh/EOivnO5dXrb6sKIgAAxqNfsFypynZJyuj+CvvazAT Imo2ISP5wQDfCUcrl2g1jaEGpfF+UiH6qp4dS4FdHb1TZleT0wKfq5lSsVborA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739283477; a=rsa-sha256; cv=none; b=FoI2O2yzqSh6Qp9rk3Uv66WsYLjRjb5n3Yq4ucM+fxkG2BWZDI/LnXZDfgEjTvZe9nmaC4 biVtNpWp4fEPx2uQLiCd5fWlL7+MsyQfwxXjvSL+HwCgOXIC7IApDrOU+EzP2LxtldJIYF Wdqh9HnBaQFlBwQcakzUYEb9CNZw4ZBzFLFbJJdi2d4zLWrBwYeu2sJkAUaeK7usWCX6vT hz2myhjZ3EcGKEKrq5vF575GucQQ0M4EXbyEKyRQhuZQbeaa0+8Ok5hL1Ui5a+9dfzku2A gvrXfeRbXvhip4d0HI6vjjigGfqfSJXjgl33Swq5IxacKzR8Cimg27xuYpmllA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ysk7948L2z1rk; Tue, 11 Feb 2025 14:17:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51BEHvXf060723; Tue, 11 Feb 2025 14:17:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51BEHvPX060720; Tue, 11 Feb 2025 14:17:57 GMT (envelope-from git) Date: Tue, 11 Feb 2025 14:17:57 GMT Message-Id: <202502111417.51BEHvPX060720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ca4eddea97c5 - main - src: Use gnu17 as the default C standard for userland instead of gnu99 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca4eddea97c54a567c25e0fcf4641a6885f33bdf Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ca4eddea97c54a567c25e0fcf4641a6885f33bdf commit ca4eddea97c54a567c25e0fcf4641a6885f33bdf Author: Minsoo Choo AuthorDate: 2025-01-09 16:13:06 +0000 Commit: John Baldwin CommitDate: 2025-02-11 14:16:25 +0000 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 --- libexec/tftpd/tests/Makefile | 1 - sbin/newfs_msdos/Makefile | 1 - share/mk/bsd.sys.mk | 3 +-- usr.bin/sort/Makefile | 1 - usr.bin/zstd/Makefile | 1 - usr.sbin/makefs/Makefile | 1 - 6 files changed, 1 insertion(+), 7 deletions(-) diff --git a/libexec/tftpd/tests/Makefile b/libexec/tftpd/tests/Makefile index 661120335ace..d1faca03331e 100644 --- a/libexec/tftpd/tests/Makefile +++ b/libexec/tftpd/tests/Makefile @@ -4,6 +4,5 @@ ATF_TESTS_C= functional TEST_METADATA.functional+= timeout=15 LIBADD= util -CSTD= c11 .include diff --git a/sbin/newfs_msdos/Makefile b/sbin/newfs_msdos/Makefile index a3ea6a6a6750..bd5b3486b6b6 100644 --- a/sbin/newfs_msdos/Makefile +++ b/sbin/newfs_msdos/Makefile @@ -9,7 +9,6 @@ SRCS= newfs_msdos.c mkfs_msdos.c .if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif -CSTD= c11 HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index c136bf1e1aff..63496e9b8ccd 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -10,8 +10,7 @@ .include -# the default is gnu99 for now -CSTD?= gnu99 +CSTD?= gnu17 .if ${CSTD} == "c89" || ${CSTD} == "c90" CFLAGS+= -std=iso9899:1990 diff --git a/usr.bin/sort/Makefile b/usr.bin/sort/Makefile index 561af217af79..46cc431edd31 100644 --- a/usr.bin/sort/Makefile +++ b/usr.bin/sort/Makefile @@ -3,7 +3,6 @@ PACKAGE= runtime PROG= sort SRCS= bwstring.c coll.c file.c mem.c radixsort.c sort.c vsort.c -CSTD= c11 sort.1: sort.1.in sed ${MAN_SUB} ${.ALLSRC} >${.TARGET} diff --git a/usr.bin/zstd/Makefile b/usr.bin/zstd/Makefile index dd54acbf83cd..0e73e2eb0dd2 100644 --- a/usr.bin/zstd/Makefile +++ b/usr.bin/zstd/Makefile @@ -25,7 +25,6 @@ MLINKS= zstd.1 unzstd.1 \ zstd.1 zstdcat.1 \ zstd.1 zstdmt.1 -CSTD=c11 WARNS?= 2 LIBADD= zstd .PATH: ${SRCTOP}/sys/contrib/zstd/programs diff --git a/usr.sbin/makefs/Makefile b/usr.sbin/makefs/Makefile index 75733714fcc2..47a41cfac813 100644 --- a/usr.sbin/makefs/Makefile +++ b/usr.sbin/makefs/Makefile @@ -15,7 +15,6 @@ SRCS= cd9660.c \ MAN= makefs.8 NO_WCAST_ALIGN= -CSTD= c11 .if ${MK_ZFS} != "no" SRCS+= zfs.c