[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint.mk: tighten "test a == b" check
From: |
Jim Meyering |
Subject: |
[PATCH] maint.mk: tighten "test a == b" check |
Date: |
Sat, 13 Nov 2010 10:45:54 +0100 |
I tried the latest gnulib in coreutils and saw these two
false positives:
src/copy.c:730: test below (*wp++ == 0) would read some
uninitialized bytes
src/stty.c:1339: test would have been (ts_lines > 64k || ts_cols > 64k
|| ts_cols == 0).
maint.mk: use "test x = x", not "test x == x"
make: *** [sc_prohibit_test_double_equal] Error 1
Here's how I've fixed it:
>From cb9aa3f4be76e093ca6377e61daa2fa23f2e5eb0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 13 Nov 2010 10:43:08 +0100
Subject: [PATCH] maint.mk: tighten "test a == b" check
* top/maint.mk (sc_prohibit_test_double_equal): Restrict this
test to files that contain something like #!/bin/sh.
Without this, coreutils would get two false positives in
the comments of C source files.
---
ChangeLog | 8 ++++++++
top/maint.mk | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f085a3d..0c4a9fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-13 Jim Meyering <address@hidden>
+
+ maint.mk: tighten "test a == b" check
+ * top/maint.mk (sc_prohibit_test_double_equal): Restrict this
+ test to files that contain something like #!/bin/sh.
+ Without this, coreutils would get two false positives in
+ the comments of C source files.
+
2010-11-12 Eric Blake <address@hidden>
bootstrap: fix typo in previous attempt
diff --git a/top/maint.mk b/top/maint.mk
index d51944b..65c2f80 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -820,6 +820,7 @@ sc_prohibit_test_minus_ao:
# Avoid a test bashism.
sc_prohibit_test_double_equal:
@prohibit='(\<test| \[+) .+ == ' \
+ containing='^#! */bin/sh' \
halt='use "test x = x", not "test x =''= x"' \
$(_sc_search_regexp)
--
1.7.3.2.4.g60aa9
- [PATCH] maint.mk: tighten "test a == b" check,
Jim Meyering <=