From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by sourceware.org (Postfix) with ESMTPS id 2EF35385042B; Mon, 24 Aug 2020 11:26:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2EF35385042B Received: by mail-io1-xd41.google.com with SMTP id z17so8220475ioi.6; Mon, 24 Aug 2020 04:26:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=y9PKsofJ51Gwh+0UTOydaA1+wTq+Hb2IB3SOleVrXP4=; b=sayd1m1jP4X756j+xWgyFTod895SHWGW0E3SmyDbrnOmLN6W/5aVLJIf1afHOBlJo0 /yyc1W7hfx6zzo9uDh7IGujky2wjvjPB+8kBKdQIwtTVFEli+4ErqaGI9t+PaOmoAgTy x4ShtJvBseFY6QSFHWGBFFECx4GVECRShu4y1we0Izvxc2CcUiYUJGPqI3oDZsSfxd87 YdpUSYAtnR5/gn2gb9fvoxngkA6+AR0o+PJvITWMtecBb/39UBcCDeWj20lV+gvIo5E/ KnXYg4BBb5vxSsILBj9KORrVUleppXXs9UZgOTcC1J8DPdZFOtlCRf1l+S7jervfMESi 1g3w== X-Gm-Message-State: AOAM532VLB0NORvDT4PsMDu9E9RavM95Qjg8jPIscvMJIRNDgeeYnebD eQZS/FLIU+nYiQD27DZJ3mMEjwiWM3OTbjR+alP6xY0c X-Google-Smtp-Source: ABdhPJxmD7d36nCpETyE3mEG5tNeZJ2TC9bhWWY5dDvez0o35O8n9QCV9cgHgSE4YVgL7/J905R0NiXgHNn5JZShMmM= X-Received: by 2002:a02:840f:: with SMTP id k15mr5181894jah.100.1598268393304; Mon, 24 Aug 2020 04:26:33 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Krystian_Ku=C5=BAniarek?= Date: Mon, 24 Aug 2020 13:26:22 +0200 Message-ID: Subject: [PATCH] libstdc++: remove unused variables To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 11:26:35 -0000 Hi, A description of the problem/bug and how your patch addresses it: I've got a small patch for -Wunused-variable in system headers. These aren't needed (i.e. no preprocessor conditions are there). Testcases: N/A, it's only a warning. ChangeLog: Sorry, contrib/mklog.py didn't quite work for me. For some reason after instruction in line 129: "diff = PatchSet(data)" my "diff" variable is always empty. Bootstrapping and testing: Tested that manually by recompling GCC, unfolding all headers with `#include ` and compiling what's been included by it. The patch itself: diff --git a/libstdc++-v3/include/tr1/ell_integral.tcc b/libstdc++-v3/include/tr1/ell_integral.tcc index 3706d8a033a..f3cf12ea2ca 100644 --- a/libstdc++-v3/include/tr1/ell_integral.tcc +++ b/libstdc++-v3/include/tr1/ell_integral.tcc @@ -78,9 +78,7 @@ namespace tr1 __ellint_rf(_Tp __x, _Tp __y, _Tp __z) { const _Tp __min = std::numeric_limits<_Tp>::min(); - const _Tp __max = std::numeric_limits<_Tp>::max(); const _Tp __lolim = _Tp(5) * __min; - const _Tp __uplim = __max / _Tp(5); if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0)) std::__throw_domain_error(__N("Argument less than zero " @@ -319,10 +317,8 @@ namespace tr1 { const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6)); - const _Tp __min = std::numeric_limits<_Tp>::min(); const _Tp __max = std::numeric_limits<_Tp>::max(); const _Tp __lolim = _Tp(2) / std::pow(__max, _Tp(2) / _Tp(3)); - const _Tp __uplim = std::pow(_Tp(0.1L) * __errtol / __min, _Tp(2) / _Tp(3)); if (__x < _Tp(0) || __y < _Tp(0)) std::__throw_domain_error(__N("Argument less than zero " @@ -498,9 +494,7 @@ namespace tr1 __ellint_rc(_Tp __x, _Tp __y) { const _Tp __min = std::numeric_limits<_Tp>::min(); - const _Tp __max = std::numeric_limits<_Tp>::max(); const _Tp __lolim = _Tp(5) * __min; - const _Tp __uplim = __max / _Tp(5); if (__x < _Tp(0) || __y < _Tp(0) || __x + __y < __lolim) std::__throw_domain_error(__N("Argument less than zero " @@ -569,10 +563,7 @@ namespace tr1 __ellint_rj(_Tp __x, _Tp __y, _Tp __z, _Tp __p) { const _Tp __min = std::numeric_limits<_Tp>::min(); - const _Tp __max = std::numeric_limits<_Tp>::max(); const _Tp __lolim = std::pow(_Tp(5) * __min, _Tp(1)/_Tp(3)); - const _Tp __uplim = _Tp(0.3L) - * std::pow(_Tp(0.2L) * __max, _Tp(1)/_Tp(3)); if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0)) std::__throw_domain_error(__N("Argument less than zero " @@ -599,8 +590,7 @@ namespace tr1 const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6)); - _Tp __lambda, __mu; - _Tp __xndev, __yndev, __zndev, __pndev; + _Tp __mu, __xndev, __yndev, __zndev, __pndev; const unsigned int __max_iter = 100; for (unsigned int __iter = 0; __iter < __max_iter; ++__iter) Best regards, Krystian