From: Jim Meyering <meyering@fb.com> Date: Wed, 30 Dec 2020 04:00:36 +0000 (-0800) Subject: regex-tests: tweak to avoid a clang-10 warning X-Git-Tag: v1.0~3270 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=18d02b74c859f374ec0975d7c40eb0171bf07513;p=gnulib.git 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) --- diff --git a/ChangeLog b/ChangeLog index cc4e456655..c2cd649695 100644 --- 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): diff --git a/tests/test-regex.c b/tests/test-regex.c index 3a3d8f1f1f..e4479a03fb 100644 --- a/tests/test-regex.c +++ b/tests/test-regex.c @@ -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