From nobody Fri Jan 27 00:28:59 2023 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 4P2z2z71Spz3bGt4; Fri, 27 Jan 2023 00:28: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 4P2z2z6Z61z4V05; Fri, 27 Jan 2023 00:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674779339; 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=5YtlRbVWNoys3BUxOWop1HwRQV11ON1mPzwdGFXqe64=; b=dgLgpp2js8dggTbWGn0yNOOTB2kPqmmqJ9e9l9ogyPUmJt/Jej1yobS4sRBKy7GO7L+WOI xDTRDbxbgQzXTOxnoJszJ9cA7sSXGvxT5Yq279XLwNe/hmfyaSCSqFZ7zUplarTS90BgTP nRRCSsQdojda/FVRh/ADjCENNJUdHVRkhXCjGjPXnF3o1F3GpV0hoZEF6enQN04pnSEl7F 0fGiLyqdAow21KYYFkMmWVY8JinOcUVWIMAx4nahdZIE8xVyWuGwylGL6RMAyQCnwWGC+G P6uLzf0nGQeGGPPxd9T0BbqyC/bYTsu3q+5ZU9PsjokQLzYkYBXJDPMYaL5EEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674779339; 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=5YtlRbVWNoys3BUxOWop1HwRQV11ON1mPzwdGFXqe64=; b=oYGSFp031RTGPBdtMosOI8EQnsvSje6BE0xThK0cHz8NoYIjwBLQPELH4jho4Clv0C25QT qYAM5QZoGl1RLcyq2FvXLPjq+UzMUYOGb+io2BhcfqJSrR4TJCSMXJufmZBXBM6y0Z2y1h uZhPNhKu3ioqbLYhoeo8BOgJrpO7V2G+HCBa21qAcqswBUvMK/d/ucD3Aermxybe0DJiuP rNnOb3T5CHvd+65EEVybFxV7UXnN268kFrFWLiuJ5r1eEvUlqBF5cNPvYf9BF7ktoFFgfZ L/QRU9ayx++o8hJaBCPMQOdJqo71pc7yZOKoMDlOU5E8yF/DkuzpLL6vikC0RQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674779339; a=rsa-sha256; cv=none; b=kljYCLpegNXKqDg20fQ/ocokKZnZeqkhgEDNk/nWP8aFFEZ09im/wPArqFETuwrVKnqDcf PDX+4vhamf+XIP1VBrnEC6EHaa7Knc2UsaBVQ44yKQd7c6HGgEYoM2Xmtwi3vloS8Dy9BQ 7MlCiq2JrphCcQ5h8EDmNLW/O0kd2yMsfd3noQ5GedUOIXJhGuB92lgXatdA0oMZ1W0T9B Ji8tmWzZYRirVGMGiXpnbcCZoRPIfuzJ2ZziIKEZnmP99S1a47T0Yohu35c8nUTIc4Cevm hmHMPQ16Z5V6qlSv7H7fk+TK5hXGwDFh5i7osc/v0U2AseOFkW5dHLFnrpux+w== 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 4P2z2z5QlbzpRv; Fri, 27 Jan 2023 00:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30R0Sxl0007986; Fri, 27 Jan 2023 00:28:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30R0SxYi007985; Fri, 27 Jan 2023 00:28:59 GMT (envelope-from git) Date: Fri, 27 Jan 2023 00:28:59 GMT Message-Id: <202301270028.30R0SxYi007985@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: 9d2f97981755 - main - : Decay expression passed to fallback version of __generic() 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 9d2f9798175586bdcd3423443804fbbc0cffb8d2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9d2f9798175586bdcd3423443804fbbc0cffb8d2 commit 9d2f9798175586bdcd3423443804fbbc0cffb8d2 Author: John Baldwin AuthorDate: 2023-01-27 00:28:22 +0000 Commit: John Baldwin CommitDate: 2023-01-27 00:28:22 +0000 : Decay expression passed to fallback version of __generic() This ensures that __generic() more closely matches _Generic() when using the fallback version when _Generic() is not available (such as GCC). Co-authored by: jrtc27 Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D38215 --- sys/sys/cdefs.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 83ba7584e5b9..1de042339c3a 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -312,6 +312,9 @@ * __generic(). Unlike _Generic(), this macro can only distinguish * between a single type, so it requires nested invocations to * distinguish multiple cases. + * + * Note that the comma operator is used to force expr to decay in + * order to match _Generic(). */ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ @@ -321,7 +324,7 @@ #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __generic(expr, t, yes, no) \ __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(expr), t), yes, no) + __builtin_types_compatible_p(__typeof((0, (expr))), t), yes, no) #endif /*