From nobody Wed Jun 28 01:33:11 2023 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 4QrPGw1Hfdz4ky71; Wed, 28 Jun 2023 01:33:12 +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 4QrPGw0gRTz3DwD; Wed, 28 Jun 2023 01:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687915992; 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=jAYsN3PMmHXdVJoIc+C2RAQBZqEE207ELv3pRsFZv/E=; b=YFRtyspC8OZm9/A07j390gRg16bK165NC7TpKiUgZxIXy/koj1qZjgEVcXktLowujro/CT 81uIuE0PTkC/2AcSlU05XjWIIANoOkWfLNABGNNHUrfiWu54WFkhqJVB9yqhBizcj8HmaG xmq/utlpBU46ZDxZJHfXIhp0AYOE8IjbvG5zqCC60gLqIgLfIzHd6iJmOBdoFJ4IQqMxmK EVFigaDmhgZYjtlG6pznJ676sWp/DfFfwrCYWFLSvkRl+6pTWvZjfQTcZKOrOgoPo5pbZG pLtCE9oO4BTd4owEP7/1Xg/j4RKtScnEVfG/mTe9Uc0BlMiprSYSSfXfhaKYYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687915992; 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=jAYsN3PMmHXdVJoIc+C2RAQBZqEE207ELv3pRsFZv/E=; b=Szf7HnKrdKG3EVPGlL4f23gkqbo1XWcEXYShoqUxwPouxs1tdVR22fOKArTNRYW1Ihqgdn DXAdctIZfK/VoGmU5dWAlhgre/0kaE8gMcBrK8dCuZam+biwsaSXrOtenp7PF/CvOUVO8d aWHNRq8yY3IMBGzdie2aOCi3fVHMtw63Z1EW7dsGbUg5nWM8z2RTQ7kVAhwy3UFT4toFQT qG9FPJyvEIsPUXDHVISqUrisxJJR2AnYxz1CejZf6o/WrYvnKCBL97MV1s/SJb7sXhwuEQ TCCStX9ioIYMqyxLRPbub9O/72qiJUAN8EMX0ib5XDsk77PJWMi+EwJ67FurZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687915992; a=rsa-sha256; cv=none; b=ks9Nj/Iwlt+KUmWka95J9n7C9+xf0wuGYc/kffnDT0ejLFcArbGX4pZA0rLeNCOyZPBqJr lLxWRSkTgeo1cKco8OcXtGzu1ge5oJQP+qMBeGn3/lnBMjsac8I7eoGpmAsZm6l0xx1YLy aA0Ad6DDHqLBDQRaJa4jH+oWJmUqTX02ohiIHSRh6HtAb+Jc9CznO/QCcf0QlfaXKuMZMq 7rNkFUy6y6x3QrVeeZekWWlth6uBi1ng/VwiM09j5CJzRVst2Z7y381WYRowxUvvcSO43h //W6PSTV+obdLx0547ZnE5b8uKz8BLzHaKrOBZWnssgr6NPBf4CgefpJ2HhdFQ== 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 4QrPGv6jl0zFyB; Wed, 28 Jun 2023 01:33:11 +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 35S1XBmm045158; Wed, 28 Jun 2023 01:33:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35S1XBDk045157; Wed, 28 Jun 2023 01:33:11 GMT (envelope-from git) Date: Wed, 28 Jun 2023 01:33:11 GMT Message-Id: <202306280133.35S1XBDk045157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7148e1593b68 - stable/13 - : Decay expression passed to fallback version of __generic() 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: Sender: owner-dev-commits-src-all@freebsd.org 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7148e1593b6866bfaf5d640d099af1931d053459 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7148e1593b6866bfaf5d640d099af1931d053459 commit 7148e1593b6866bfaf5d640d099af1931d053459 Author: John Baldwin AuthorDate: 2023-01-27 00:28:22 +0000 Commit: John Baldwin CommitDate: 2023-06-28 01:32:47 +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 (cherry picked from commit 9d2f9798175586bdcd3423443804fbbc0cffb8d2) --- 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 3d45271d3e31..28e464122e58 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -313,6 +313,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) || \ @@ -322,7 +325,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 /*