From patchwork Fri May 12 16:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 93284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5252989vqo; Fri, 12 May 2023 09:54:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5W3Dg/U56oO2t+xpQ9pzHC5/kc4io3SFBEdWHJRb1/01ukuZ/yW2HOoEfniQbf90TnRO/W X-Received: by 2002:a17:906:dac1:b0:961:8fcd:53cc with SMTP id xi1-20020a170906dac100b009618fcd53ccmr21944510ejb.42.1683910455799; Fri, 12 May 2023 09:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683910455; cv=none; d=google.com; s=arc-20160816; b=I0NUMdzf5HOcAqMUwZcYJ6Dbn8XOkztmu44JuVm4GJl5ptz6x6bD+d0rmWCLn+2Sdu fFEAtIJgxSOPaERMpBQHiRZ7cBW5nk8qqiu8eSSuMqQeV+kZVFX9rGiEEBveWIcN8S+o GK0GaX2ZMgt46+hRmGJ5Nsi2q5VviCVE0RaxR1kEy0wxrv4MOrVeh3c8T/jClauKoLKD /0p9l7IE3BLds7FFTgUQlV03VoO1uXRAIT0TbWCZEeqpWj+LjekfuDm7PHYJzs6h3OXu L1NlHXu1ZMu0QjpLaVFK/1PcOpdn+n0Fsk028FNamHmoINtUt7EFZVOHSYF8S+c1Flc/ 4FFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Bz6g2KDLBKgj3827Q/Q6V2ADQOCer8hO5ytfYxBm+Dc=; b=NIsBarEfblQYDHq1CATih1AAl4WxboVdG8Ic139yA0hVMvYml/EdXV2qNJwosoPiSU tYhOlganb6Bj+6fkXnNe7ZfmI/2FgRGweWDgNosdakQrG3JYdRNl3DGWZk0AZZ2HZjXW CvkEMXKBEUslhtMuPmjt/XC56ona4dmSH70uwOYvrKgWCsPQX4g6SWea56F/kTPhQH0u k/7zMWraU+saKjNTXVCMbAMnVqQy1i1RaOyL1YsV3ZjoRUEzp5OT8/RxTbiKhu9rdsId MietoxkFmXcPmcPCEeL89H12axTEwaUwwHZxWE5bZ4MZt6EJED2RHON8lNRN3vZgUOm/ B2tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=tBt9hy+1; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fy22-20020a1709069f1600b0096a24c1ec90si5266525ejc.756.2023.05.12.09.54.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 09:54:15 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=tBt9hy+1; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB49C3853816 for ; Fri, 12 May 2023 16:52:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB49C3853816 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683910354; bh=Bz6g2KDLBKgj3827Q/Q6V2ADQOCer8hO5ytfYxBm+Dc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=tBt9hy+1lmH8sjCa+D0yflysrVoJ9TTotIMA9BcEcl75bpmq2gAf2rJQVTa4c/OCP m0GhfE/Z3z86sshtNr4mwuWtlhVnyoR93YfbojUjEbqNpqP9xJhVmve5dn97ku93CV fU3IGmAC6UV3iBjvljnPJlZ+zqn9lInKkKnZtGnk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id C0ECD385417C for ; Fri, 12 May 2023 16:49:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0ECD385417C Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-186-fVRRoegVOdOUj43p_44n-g-1; Fri, 12 May 2023 12:49:15 -0400 X-MC-Unique: fVRRoegVOdOUj43p_44n-g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F32E92A5956D; Fri, 12 May 2023 16:49:14 +0000 (UTC) Received: from localhost (unknown [10.42.28.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA6C4400E89; Fri, 12 May 2023 16:49:14 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix -Wnonnull warnings during configure Date: Fri, 12 May 2023 17:49:14 +0100 Message-Id: <20230512164914.1303446-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765708090015537998?= X-GMAIL-MSGID: =?utf-8?q?1765708090015537998?= Tested powerpc64le-linux. Pushed to trunk. -- >8 -- We should not test for nan by passing it a null pointer, as this can trigger -Wnonnull warnings. Also fix an outdated comment about the default -std mode. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_CHECK_C99_TR1): Use a non-null pointer to check for nan, nanf, and nanl. * configure: Regenerate. --- libstdc++-v3/acinclude.m4 | 8 ++++---- libstdc++-v3/configure | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 89e7f5f5f45..42a8e7a775e 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1620,7 +1620,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ AC_LANG_SAVE AC_LANG_CPLUSPLUS - # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__ + # Use -std=c++98 because -std=gnu++98 leaves __STRICT_ANSI__ # undefined and fake C99 facilities may be spuriously enabled. ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++98" @@ -1885,9 +1885,9 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ lround(0.0); lroundf(0.0f); lroundl(0.0l); - nan(0); - nanf(0); - nanl(0); + nan(""); + nanf(""); + nanl(""); nearbyint(0.0); nearbyintf(0.0f); nearbyintl(0.0l); diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 99f4927aa8c..d4286b67a73 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -19731,7 +19731,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__ + # Use -std=c++98 because -std=gnu++98 leaves __STRICT_ANSI__ # undefined and fake C99 facilities may be spuriously enabled. ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++98" @@ -20106,9 +20106,9 @@ typedef double_t my_double_t; lround(0.0); lroundf(0.0f); lroundl(0.0l); - nan(0); - nanf(0); - nanl(0); + nan(""); + nanf(""); + nanl(""); nearbyint(0.0); nearbyintf(0.0f); nearbyintl(0.0l);