From nobody Fri Apr 12 22:42:46 2024 X-Original-To: dev-commits-src-all@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 4VGWmR029Wz5GHdw; Fri, 12 Apr 2024 22:42:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VGWmQ6bcdz4trl; Fri, 12 Apr 2024 22:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712961766; 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=rVHjPjtO4fbgi7Tni9GqtYBZWhXuBNALdXdkEADlxK4=; b=caMrebxbMA5USH0Fyc7S3Sm0HE9avE3EfdKJAgK4gA56C3ChwE5VDAxKvQznqdxloPO4uN sHb2ZSOm5+TDfDgyxN9q/0iU8hFQx4npmJQQtXei1RAlDrY4YWtACTb1w0EhNqj0V4ga66 h7VFThDrJ9rB3nWoNiN4Jtgi6sXTXw0Sd2M+cbN2rvNd+fMG80Vy5z7JwD2E9rDnMTr2W8 SwY20IL3lQwdvy3S/wqKnDune11b+pCioe9efy4ZKwJiuBznPw/ZryENooxxIvSXETn3/R SfA1GGwcBPOVWo1wm8j6ZRWlH7EyXJ60jtg+eLsmfiwlAnhHDctibWi+8oEAmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712961766; a=rsa-sha256; cv=none; b=rbn9mVZYTbRYPnB6bCGoGA3awty0tpvHzrvUdx30I/WQXopImtEPiNFnckHJaDMK7XABc+ KlbNxikk51jjXpHWMZ9h3rNw9p2PXZOY2OllcppZ8NfacFG8mrHAw5rBu2ysucTJlozX9n UO63jYNJ3BkmRGR1doDtkZ36Nd1QoLONFux5WTfiW3TaSo8vmBagKSYOXvaohm2tTxFO6Q AFsXKYEqRpU7x3FESw58j9t3IFpKb12jVkCcBWeZfsLhQnTujtVQIr8NAsWw+yHvheuMqw oiK9b3Vv2c/83yICSGxhQ2LX/uEmk8tR5QDWffg/7krmGyK7Q7rsejk7Tt4JiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712961766; 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=rVHjPjtO4fbgi7Tni9GqtYBZWhXuBNALdXdkEADlxK4=; b=k5Fpv8//eo5uirjGODAW7jqhYeuSWD9m6PljTBAZJs4bmiNlEl61CbwxkgcnNt0aBrkSd9 rFlrhxQqnWZt/D3UbiVeB5bL+6J+hVVeCDjbg6/CKNzyRB/0gocGoddbwXj7iOPhXeW5eZ xQ8EPzWSWnkjS1VBWokqOY8gVJa9JelV3XLPNDAFaRSFW6ECsgWyPheHhy2Dtft5AAW/gd rGZFM3vYcihswA+/uju+c7nJKHGpsRnxduNSeTihV+U94TGEJiE2a7FBt2LJIsy3uMiTe/ 7FuUiL53W9771oBaqkWjX10qMvijiOk+TJVfH3ubYgxu9BElQp6bJkne/C3a8g== 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 4VGWmQ6Bpfz176b; Fri, 12 Apr 2024 22:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CMgkpq034617; Fri, 12 Apr 2024 22:42:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CMgk6B034614; Fri, 12 Apr 2024 22:42:46 GMT (envelope-from git) Date: Fri, 12 Apr 2024 22:42:46 GMT Message-Id: <202404122242.43CMgk6B034614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 606c37c54160 - main - nproc: Prefer sys/cdefs.h __unreachable over the builtin List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 606c37c54160479130a7337e45efbdf01d013b13 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=606c37c54160479130a7337e45efbdf01d013b13 commit 606c37c54160479130a7337e45efbdf01d013b13 Author: Collin Funk AuthorDate: 2024-04-12 22:38:18 +0000 Commit: Warner Losh CommitDate: 2024-04-12 22:39:05 +0000 nproc: Prefer sys/cdefs.h __unreachable over the builtin The __builtin_unreachable macro provided by Clang and GCC is a hint to the compiler used for optimization. The programs work fine even if the compiler doesn't support it. The sys/cdefs.h has had __unreachable for 9 years (commit 732b31de5d9244bd1cc98192e09ee1881e9f55e9). It expands to the builtin if it is available. In the rare case that it is unsupported it expands to a null statement so compilation does not fail. Signed-off-by: Collin Funk Reviewed by: imp, freebsd@igalic.co Pull Request: https://github.com/freebsd/freebsd-src/pull/1117 --- bin/nproc/nproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nproc/nproc.c b/bin/nproc/nproc.c index c2ab75826ce1..d8affe11b796 100644 --- a/bin/nproc/nproc.c +++ b/bin/nproc/nproc.c @@ -94,7 +94,7 @@ main(int argc, char *argv[]) break; case OPT_VERSION: version(); - __builtin_unreachable(); + __unreachable(); case OPT_HELP: help(); exit(EXIT_SUCCESS);