public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Krystian Kuźniarek" <krystian.kuzniarek@gmail.com>
To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: [PATCH] libstdc++: remove unused variables
Date: Mon, 24 Aug 2020 13:26:22 +0200	[thread overview]
Message-ID: <CAHqJ0wFw0-Kys=mBgJHMvZ6M0NBQbJUFrsvf14k7saTbMNPW-g@mail.gmail.com> (raw)

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 <stdc++.h>` 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

             reply	other threads:[~2020-08-24 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 11:26 Krystian Kuźniarek [this message]
2020-10-31 12:24 ` Krystian Kuźniarek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHqJ0wFw0-Kys=mBgJHMvZ6M0NBQbJUFrsvf14k7saTbMNPW-g@mail.gmail.com' \
    --to=krystian.kuzniarek@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).