From nobody Fri Oct 17 22:41:07 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 4cpKYH6mkfz6CqmZ; Fri, 17 Oct 2025 22:41:07 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cpKYH68crz44dx; Fri, 17 Oct 2025 22:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760740867; 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=ONgE82iMzXEwivActnL+Vq9r6tob/F7/8om7lDP3rgw=; b=wFuB/IJ91Nr83BGJE/hmd5T3uKL/MOw2lk3eO8bb7lW4ZjWq4UkId1VTRH2HG6tn8vM4gW jCYqxcw0grLeNQj7OV7WP8UIHH8JZGFd7DShpc6C5gWFjl7iLDvyzluqNmsa67GS9KYHZH G5WKgxXG0/rm0HeY9wC5hRrgF0Q7OSlH8e1kv2mHYjyFQ63idM/YODAD3bOIRbEhiapVlZ UNyNhzbrl7xIkkPfkd1Fnj2SUyn27EVHIYrET3W0CvMmNwB6t+sNVMWQNfyhNpkuBZZ6u/ bOYXwLMv6TMMunxRuAgo3w3cjK32HFEyrXm/HOyMSF09PgVM7HmpSmMX7qCRGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760740867; 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=ONgE82iMzXEwivActnL+Vq9r6tob/F7/8om7lDP3rgw=; b=otOtHe4kJ9gN6HYFLCtYtuCgwhipTmJshpzAhM9W9FkDe2nBZNv9ebEh3rWFvj0Ac49R7C UvZwGmcVK6F5HKUGMHg97nIvh1R5UkiI+zx85da68rOcjH0JPFx9m060AAFZePjsS+nPeV uWG/R8Uv8m9HTd93ewNuo4aIBGmqHKQsIKN+QhEFNoZ2fe64TVTaENzzdX2kCMidtY1omO 3uDWSvveMVP6Yn3IqZUZKZtLNI6c/EnxA8gwniUd4arKuY8GdhpliY111U/I1kEI1ier4x q1gz0NxaDvC9GpbCrEhU/sjznl1JxBp78j65lkJqA37LnNIcXO4hpeSqaFtjXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760740867; a=rsa-sha256; cv=none; b=Fn9gl0uyblPShsNU801PKvUXbafk3uC1tvl1/emDkMc2kksplDNljagbKNA+/y+D01GV43 RzJgXTAQC3zUwtpw09uJd9nAmUI7cSWlSrOLv3VFcncq4hKoIxgzWl490Zn+OKeP8wla7T HjnzZEENU3w/44oSRHXqM2sltrZJMWMYmk4cARRUwKF6XEvHd3Os/SRkTJug9JxUQDISCC lrB18RFJy4Wz1ipNGwFH6Rpu2mmId5MlZoKUcAIPfl/A+WJZ2qY/ZyVI20MqZ4LlIBRzUK WB9Zc5IQ1fBbGFW8SrfYSID3qCOhUlZV18zCPPWjwf/jeXQ7f5viY9Y32dQR5A== 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 4cpKYH5mDlz1Cny; Fri, 17 Oct 2025 22:41:07 +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 59HMf7cD023452; Fri, 17 Oct 2025 22:41:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59HMf7TE023449; Fri, 17 Oct 2025 22:41:07 GMT (envelope-from git) Date: Fri, 17 Oct 2025 22:41:07 GMT Message-Id: <202510172241.59HMf7TE023449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3c052bec12fc - main - include/stdckdint.h: make the header compatible with C++ 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c052bec12fcf09f81ba0760ebecec38e196d332 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3c052bec12fcf09f81ba0760ebecec38e196d332 commit 3c052bec12fcf09f81ba0760ebecec38e196d332 Author: Konstantin Belousov AuthorDate: 2025-10-17 03:49:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-17 21:48:30 +0000 include/stdckdint.h: make the header compatible with C++ by removing the cast to _Bool. The _Bool type is not defined for C++, and the specification from the gcc info doc states that the return type of the __builtin_{add,sub,mul}_overflow() is bool already. This is done instead of including stdbool.h to avoid namespace pollution, since defining bool from stdckdint.h simingly is not sanctioned by ISO/IEC 9899:2024. PR: 290299 Reviewed by: des Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53149 --- include/stdckdint.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/stdckdint.h b/include/stdckdint.h index af3074dded89..9cb877fe8198 100644 --- a/include/stdckdint.h +++ b/include/stdckdint.h @@ -13,7 +13,7 @@ #if __GNUC_PREREQ__(5, 1) || __has_builtin(__builtin_add_overflow) #define ckd_add(result, a, b) \ - (_Bool)__builtin_add_overflow((a), (b), (result)) + __builtin_add_overflow((a), (b), (result)) #else #define ckd_add(result, a, b) \ _Static_assert(0, "checked addition not supported") @@ -21,7 +21,7 @@ #if __GNUC_PREREQ__(5, 1) || __has_builtin(__builtin_sub_overflow) #define ckd_sub(result, a, b) \ - (_Bool)__builtin_sub_overflow((a), (b), (result)) + __builtin_sub_overflow((a), (b), (result)) #else #define ckd_sub(result, a, b) \ _Static_assert(0, "checked subtraction not supported") @@ -29,7 +29,7 @@ #if __GNUC_PREREQ__(5, 1) || __has_builtin(__builtin_mul_overflow) #define ckd_mul(result, a, b) \ - (_Bool)__builtin_mul_overflow((a), (b), (result)) + __builtin_mul_overflow((a), (b), (result)) #else #define ckd_mul(result, a, b) \ _Static_assert(0, "checked multiplication not supported")