]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
test-math-iscanonical.cc: Replace bool with int
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 4 Oct 2017 00:41:32 +0000 (17:41 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 4 Oct 2017 22:03:10 +0000 (15:03 -0700)
Fix GCC 7 compilation error:

test-math-iscanonical.cc: In function ‘void check_type()’:
test-math-iscanonical.cc:33:11: error: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Werror=deprecated]
     errors++;
           ^~

Since not all non-zero error counts are errors, return errors != 0
instead.

* math/test-math-iscanonical.cc (error): Replace bool with int.
(do_test): Return errors != 0.

(cherry picked from commit cdd4155d6c527c00a89606385859984e35bd2910 and
 commit 758f1bfa2a1bccb52f1b3e97444a367d35aceaee)

ChangeLog
math/test-math-iscanonical.cc

index fea4fd0cd6a43e294284f18dc5c73e122f6f3be6..d7a185e99d04b83fdab61bfc3e53eebfc382325a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * math/test-math-iscanonical.cc (error): Replace bool with int.
+       (do_test): Return errors != 0.
+
 2017-10-03  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
        [BZ #22235]
index aba68acb4f8d808abd44eb27fc3922dfaf82c3cc..4cfb1c50553891ee6e74b0d0bc6c01041d3b2d35 100644 (file)
@@ -20,7 +20,7 @@
 #include <math.h>
 #include <stdio.h>
 
-static bool errors;
+static int errors;
 
 template <class T>
 static void
@@ -42,7 +42,7 @@ do_test (void)
 #if __HAVE_DISTINCT_FLOAT128
   check_type<_Float128> ();
 #endif
-  return errors;
+  return errors != 0;
 }
 
 #include <support/test-driver.c>