From nobody Wed May 22 08:31:59 2024 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 4Vkl0H5FYgz5LD08; Wed, 22 May 2024 08:31:59 +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 4Vkl0H3RmGz4jDr; Wed, 22 May 2024 08:31:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716366719; 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=DECalKj5ot6reNhIRYo2nA/XKIpl1h5RQ7rq7d6SXX8=; b=Hj708paaSaVgUzlLUmVPKZP4msWxXKQGV1ppbI8t7HZGlJjr6CrygCADZPX+uCgtmyzwA2 9g2TgujcqdghAM0D0/o0GMyfp9lmJAWnj/LN0c9jxWiTmgniXDsg1j0G8WheVCVAbnNSk1 JYATxBU/63J5PZ8xuGjClsnGtkKRoj7PSAeIcYBYsNpYjX0FUl7geyslZzYF08lQaa5XTc F07Uwsmrc4EQNqsMXS7olASMcepy4VjPYOMKhoYCs2/NnAULRmfABNqvptl5hCgSrMHHRy lqU5xuZOmPdDbNJ/RC7kKAgvGB0notmTjs58LQUcYYfuI5VCk32P6CoO6h/rQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716366719; a=rsa-sha256; cv=none; b=ctiVzYoH7Xz5DdetTBAHlYRZD9MKGs4L1bKi/lDWK7o/EZFFnsKBtSKIogoPWQdYDhMwpN fiIoKReneMb4p/CLvE+ZdCy/pdY0jfTder0/IWM7cFCHN8A0fOyTGa1bFe1ZBLmW4HaM1x tekLzKnlDMEnS5qAk0rIZMUmpNDBShQwnL4ytzeN9huQedS4TYJO0a7FUMMBeaF/WA5+Gn IunNUruvf7j63BB4X2A+DzYa9ZP28G/8mEmy3s4SQfhtNXd0P21qb17SyhmEvNzzicYpLE 3eijDhlV2zYA0yYoD/r8LMMppiyhINvEfKpOfgBLzdcu90Bq9KAyEKzjT5cP+Q== 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=1716366719; 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=DECalKj5ot6reNhIRYo2nA/XKIpl1h5RQ7rq7d6SXX8=; b=oK2a1XNScLzojkXqRVUO9UM1JS/4/jA9YcA3PenV5wSbFAqlZTyg/oAnUNEpkyqUsxxN1T pKIHkC8e3XpH/T/4NTGqWoR+jAYWjm7SfUpmnJhc2dBJcyWZ5AtpQax9keuQNV375bnmfH i0l+n2m6g+A8Agq0k/sfo9CrMR877adi2ujJn6mifGOfUdmZj+BiuJgxYQax8hI5bn9KQC ftLPLQnScBjLulWclkIyc7E8qEibu/JCocs/xju1O/lSLkwE133yH+wgQJmnwBF5k1Y7Lo pPYXtA/pVZhL8mPjAjhxyt+bR/YuTm1k2dtxuj9KcdnIcNydPSRS0OWn5qNCow== 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 4Vkl0H345pzyhW; Wed, 22 May 2024 08:31:59 +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 44M8VxIU008810; Wed, 22 May 2024 08:31:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44M8Vx61008807; Wed, 22 May 2024 08:31:59 GMT (envelope-from git) Date: Wed, 22 May 2024 08:31:59 GMT Message-Id: <202405220831.44M8Vx61008807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 940155d24afb - main - sys/sys: Fix __builtin_is_aligned fallback 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 940155d24afb5c80ce7fde59c856c5c0d5c6dbe1 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=940155d24afb5c80ce7fde59c856c5c0d5c6dbe1 commit 940155d24afb5c80ce7fde59c856c5c0d5c6dbe1 Author: Andrew Turner AuthorDate: 2024-05-22 08:18:26 +0000 Commit: Andrew Turner CommitDate: 2024-05-22 08:18:26 +0000 sys/sys: Fix __builtin_is_aligned fallback When the compiler doesn't provide __builtin_is_aligned we use macro as a fallback. The macro was missing brackets around one argument. This could lead to incorrect results when the argument is more complex than a single stagement. Fix this by adding the needed brackets. Reviewed by: brooks, imp, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45260 --- sys/sys/cdefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index a6545a29a302..037dfa55f923 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -902,7 +902,7 @@ /* Provide fallback versions for other compilers (GCC/Clang < 10): */ #if !__has_builtin(__builtin_is_aligned) #define __builtin_is_aligned(x, align) \ - (((__uintptr_t)x & ((align) - 1)) == 0) + (((__uintptr_t)(x) & ((align) - 1)) == 0) #endif #if !__has_builtin(__builtin_align_up) #define __builtin_align_up(x, align) \