From nobody Fri Jul 15 18:10:25 2022 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 4Lkzt96H9tz4THSw; Fri, 15 Jul 2022 18:10:25 +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 4Lkzt95t3Nz3XVX; Fri, 15 Jul 2022 18:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657908625; 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=AZYK2Ea9vfbvDQsCl1L9G9H2PVkkPIUMgbvFPNlYouE=; b=qayHx5Lgp0/2/COZxxvnEO2n3iKTDi5+M46W86U+5XGm6bm5gIn708FcfF0IUEbGiOVieG 1bXVw2HIeL5jnoQ2Y2scawvF8u3QPP8uCtuSNrZSZIYr2st0Fs36LmzgY4Teo+7tci4nCW oZyNTh6d4YIZ/xrUYo+TJRiC6hI/3vMLIA9d5+Tt4+JT11nAVIfHHBjQ/sbPX3WAaBm8/2 jUgTlzyYcqKpmkIovmobA+uffthLKeB6l8vFCTpEZ5XFrsiHz1RxuCTd+5MzmaEst6Dl2s ZQVmD0WiSplIn3S77huszVCJoF5DBHxDw8/QABcL9fAi8cnZdSRZLTBFM8oYjw== 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 4Lkzt94xrSzrly; Fri, 15 Jul 2022 18:10:25 +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 26FIAPKu069392; Fri, 15 Jul 2022 18:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26FIAPMC069391; Fri, 15 Jul 2022 18:10:25 GMT (envelope-from git) Date: Fri, 15 Jul 2022 18:10:25 GMT Message-Id: <202207151810.26FIAPMC069391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: e50027e38d4f - main - Remove unnecessary const and volatile qualifiers from __fp_type_select() 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e50027e38d4f93887691f87b024e0abf37e98c78 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657908625; 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=AZYK2Ea9vfbvDQsCl1L9G9H2PVkkPIUMgbvFPNlYouE=; b=eFORkG7tqiJcg6E0R0UH4pn3SBec/OdM+dp4lxKk1x4SrvgQzCex6XkHm1FoR6+nebiwXk uld324IrGFGT7QGQFHbwHTKkAXOWa4VhKOiZfGeGOQZTPPus9MCLk6KMqbo91bAkAqT9zU pWurJA9hEBPE6xtkFBB/5yTGWTi3E2sWLE/axp8PD7eDexdgx/VJQzr51/wiFTRQynCkgg VZt3xl3BstKQDNfgAX6vLxNKK1KfhktAze7db0YR3OZ0kryts9JpudX3en7/yzCzOZI+vf FszvrigMjpWhU6KKsARqUubZ3VhrdieP36+i0CG09M39DoK/cnjq92YRcVyOxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657908625; a=rsa-sha256; cv=none; b=DL+5OgX51B+t4vG4PQzHIyCwE3D33iZ13pgLTXzuDfq3KPDTKF6IcoeknvvoRAXBub75Sd Ktun/bPJk3t8mp4XW+j9AEBtqSmGnMfvkzR46vm5R8YLl4iyO3tOmKrjqxParFvRPP99u2 1bDSC3JaOiSONktJYEx0XMoNiPcN1/HoCjFGWs1vKUnIjrq8fTlLd/3cmJUs7QlzK9/o7v T8JtuD6N0wAqzIBGPoOOqyC8MMbDMOymGdUrWAASrMmOXLaEw37OxQhoQ6z/lEoca1Wwqk FSwfIzJ0RAZdBZr45Cz2iVJ0fCRxMp0XP8IjNJz9sWp5LkhVzKS9+18WZ+sxyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e50027e38d4f93887691f87b024e0abf37e98c78 commit e50027e38d4f93887691f87b024e0abf37e98c78 Author: Dimitry Andric AuthorDate: 2022-07-14 11:20:52 +0000 Commit: Dimitry Andric CommitDate: 2022-07-15 18:09:27 +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 --- 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 98601f825bbe..a0edea04dde2 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), \