From nobody Sat Jul 23 08:58:57 2022 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 4LqgGB27mCz4X77b; Sat, 23 Jul 2022 08:58:58 +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 4LqgGB1C4tz3gkN; Sat, 23 Jul 2022 08:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658566738; 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=k1PId7CUNc8sdUUwoBjsQml4FJ61cs9WD6FaogiO1fE=; b=ky+bXLGDBw2G+03nNCC2rLydlEbEinIKe7V9k9WvK0jOZHkLckcO+QPlcI2FkAsf9ooiQB 8GemCIQh3BRDDtBEmg13gXQTCO9TwL1iH1LVouooEZ25EcYLHaNE3uYjvFl5FljDgBuLp/ OTpo7FNPVqb9k4voIuHKi+3i4XqkwG5bVjBQ5vWpctsyBlOhLn3OV18baOQASMtWqrSD8B +gBAJeN6bKQcH5vLeU07RwCGnLXZV8SSeaJ8+h+CJGR4y1F+vxWc8FbpM0WTeF6wBBiY8T lUDzR8Kvw21zQUSoK7TnjuVsWLelHNB1bmM6Mh/nmTg25BgGUquwjt5wPaAU0g== 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 4LqgGB01J0zZDV; Sat, 23 Jul 2022 08:58:58 +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 26N8wvYO013270; Sat, 23 Jul 2022 08:58:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26N8wvAx013269; Sat, 23 Jul 2022 08:58:57 GMT (envelope-from git) Date: Sat, 23 Jul 2022 08:58:57 GMT Message-Id: <202207230858.26N8wvAx013269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 0bbd0daf4ee5 - stable/12 - Remove unnecessary const and volatile qualifiers from __fp_type_select() 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0bbd0daf4ee5b4b7b8ec7650f2c65c499c0d103d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658566738; 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=k1PId7CUNc8sdUUwoBjsQml4FJ61cs9WD6FaogiO1fE=; b=CI/ZFxrX6H33F3fR/v3T14ug4obnoXpPr8/V4N/O06GQSEmlUGnTahw9seapn7a/EoNZpN CaJm0FO9OZlc+AWilIyOZID52aqS8lxhBAqA0BN0UtYtnZcBc5LX28WCJzdr7pM9klaB+r PY+ZLFf854ovh/3T3Lzl8JmXWMxu6OimAHemYBPkbT7Qynma6F9rtzhHbRkYsh/zOX4K+5 7VdE89IiiBx1OOrabjdQV0XVMshgqCDv4gJ56ew+YGYgqz4BH8JlGV4i/Ti460ZCQRfhJH vpz6BQpSnvw/FHoAjjZzGCgKBofMRHRXUb+aZE4nFkrYeeCIg2yqT7qWhDEnPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658566738; a=rsa-sha256; cv=none; b=PgqmxZaIDrJFUELni1z2YpvahZ+Q5lyZQA0LCZDWK6AVjezFpeBu2DOxG9k3PC/5erSeGw O47UfMgSc0FypJ0rykpnd5ZhyHWV0ibtWSLZdN70OvjtHYni0dcDCuoRO77HGvXxlACpni 39f2WzrhA4llSpUxfxgcs/GKs8pEgc4vhwJ2XFk/bDx7asNYAqc5kSLn6J0l8pWMtDqFxE E51UfYnSBi3Zhv0Ru5pZaWDJzE7Q+R02ASJ4UMcXqGSmYyMoSRqMRCxCUQ5Oyulz482U1g 8zEQbkiQSY2wGvoaRF8LgW4p5O2CsHu1CMfJ5Gz6NcezsCEjVs6Iz/yLD1SGbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=0bbd0daf4ee5b4b7b8ec7650f2c65c499c0d103d commit 0bbd0daf4ee5b4b7b8ec7650f2c65c499c0d103d Author: Dimitry Andric AuthorDate: 2022-07-14 11:20:52 +0000 Commit: Dimitry Andric CommitDate: 2022-07-23 08:57:42 +0000 Remove unnecessary const and volatile qualifiers from __fp_type_select() Since https://github.com/llvm/llvm-project/commit/ca75ac5f04f2, clang 15 has a new warning about _Generic selection expressions, such as used in math.h: lib/libc/gdtoa/_ldtoa.c:82:10: error: due to lvalue conversion of the controlling expression, association of type 'volatile float' will never be selected because it is qualified [-Werror,-Wunreachable-code-generic-assoc] switch (fpclassify(u.e)) { ^ lib/msun/src/math.h:109:2: note: expanded from macro 'fpclassify' __fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyl) ^ lib/msun/src/math.h:85:14: note: expanded from macro '__fp_type_select' volatile float: f(x), \ ^ This is because the controlling expression always undergoes lvalue conversion first, dropping any cv-qualifiers. The 'const', 'volatile', and 'volatile const' associations will therefore never be used. MFC after: 1 week Reviewed by: theraven Differential Revision: https://reviews.freebsd.org/D35815 (cherry picked from commit e50027e38d4f93887691f87b024e0abf37e98c78) --- lib/msun/src/math.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index 2a42c14c6cc2..95dc62e9b50b 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -81,16 +81,7 @@ extern const union __nan_un { #define __fp_type_select(x, f, d, ld) __extension__ _Generic((x), \ float: f(x), \ double: d(x), \ - long double: ld(x), \ - volatile float: f(x), \ - volatile double: d(x), \ - volatile long double: ld(x), \ - volatile const float: f(x), \ - volatile const double: d(x), \ - volatile const long double: ld(x), \ - const float: f(x), \ - const double: d(x), \ - const long double: ld(x)) + long double: ld(x)) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ __builtin_types_compatible_p(__typeof(x), long double), ld(x), \