]> Savannah Git Hosting - gnulib.git/commitdiff
regex-tests: tweak to avoid a clang-10 warning
authorJim Meyering <meyering@fb.com>
Wed, 30 Dec 2020 04:00:36 +0000 (20:00 -0800)
committerJim Meyering <meyering@fb.com>
Wed, 30 Dec 2020 04:00:36 +0000 (20:00 -0800)
* tests/test-regex.c: Compare with explicit zero, rather than
as boolean to avoid this from clang-10:
test-regex.c:315:9: error: converting the result of '<<' to a \
  boolean always evaluates to true \
  [-Werror,-Wtautological-constant-compare]
if (! REG_STARTEND)

ChangeLog
tests/test-regex.c

index cc4e45665574db07c1a8ef08932ee0284c2e7435..c2cd6496951aaa26eca1923e34e9cb7ed19b8112 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2020-12-29  Jim Meyering  <meyering@fb.com>
 
+       regex-tests: tweak to avoid a clang-10 warning
+       * tests/test-regex.c: Compare with explicit zero, rather than
+       as boolean to avoid this from clang-10:
+       test-regex.c:315:9: error: converting the result of '<<' to a \
+         boolean always evaluates to true \
+         [-Werror,-Wtautological-constant-compare]
+       if (! REG_STARTEND)
+
        hash: add casts-to-float to avoid clang-10 warnings
        * lib/hash.c (compute_bucket_size): Cast SIZE_MAX to float
        to avoid this warning from clang-10 (for use in grep):
index 3a3d8f1f1fffe5308f62ddffe4eb221ba312cf48..e4479a03fb8c45727236dc1c44f5fc749a42dbce 100644 (file)
@@ -312,7 +312,7 @@ main (void)
 
   /* REG_STARTEND was added to glibc on 2004-01-15.
      Reject older versions.  */
-  if (! REG_STARTEND)
+  if (REG_STARTEND == 0)
     report_error ("REG_STARTEND is zero");
 
   /* Matching with the compiled form of this regexp would provoke