Fix warning with -Wsign-compare -Wsystem-headers
authorJonathan Wakely <jwakely@redhat.com>
Thu, 16 Aug 2018 17:16:33 +0000 (18:16 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 16 Aug 2018 17:16:33 +0000 (18:16 +0100)
* include/tr1/legendre_function.tcc (__sph_legendre): Avoid warning
about signed/unsigned comparison.

From-SVN: r263596

libstdc++-v3/ChangeLog
libstdc++-v3/include/tr1/legendre_function.tcc

index fdf992ef10120510a1fef7aa2cb018598c4c80c0..9477a33fb7f37f540458e74021bd1e97efd16a63 100644 (file)
@@ -1,5 +1,8 @@
 2018-08-16  Jonathan Wakely  <jwakely@redhat.com>
 
+       * include/tr1/legendre_function.tcc (__sph_legendre): Avoid warning
+       about signed/unsigned comparison.
+
        * include/std/ostream (basic_ostream::sentry::~sentry): Suppress
        deprecation warnings for using uncaught_exception().
 
index 85ca7969f5b36b2d87327ef80c9e923e5545b707..e75414c5296e5f66f498503fa7eba55a8aa23a32 100644 (file)
@@ -284,7 +284,7 @@ namespace tr1
               _Tp __y_lm = _Tp(0);
 
               // Compute Y_l^m, l > m+1, upward recursion on l.
-              for ( int __ll = __m + 2; __ll <= __l; ++__ll)
+              for (unsigned int __ll = __m + 2; __ll <= __l; ++__ll)
                 {
                   const _Tp __rat1 = _Tp(__ll - __m) / _Tp(__ll + __m);
                   const _Tp __rat2 = _Tp(__ll - __m - 1) / _Tp(__ll + __m - 1);