maint.mk: tell sc_prohibit_strcmp to ding "0 == strcmp (...)", too
authorJim Meyering <meyering@redhat.com>
Fri, 24 Feb 2012 08:45:54 +0000 (09:45 +0100)
committerJim Meyering <meyering@redhat.com>
Fri, 24 Feb 2012 11:47:43 +0000 (12:47 +0100)
* top/maint.mk (sc_prohibit_strcmp): Also prohibit uses of strcmp
uses with "==" *before* the call, e.g., 0 == strcmp (...)
Remove now-unnecessary str''cmp obfuscation.
Suggested by Akim Demaille.

ChangeLog
top/maint.mk

index 43bfdf5..681d773 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-02-24  Jim Meyering  <meyering@redhat.com>
+
+       maint.mk: tell sc_prohibit_strcmp to ding "0 == strcmp (...)", too
+       * top/maint.mk (sc_prohibit_strcmp): Also prohibit uses of strcmp
+       uses with "==" *before* the call, e.g., 0 == strcmp (...)
+       Remove now-unnecessary str''cmp obfuscation.
+       Suggested by Akim Demaille.
+
 2012-02-24  Bruno Haible  <bruno@clisp.org>
 
        streq: Rename macro.
index 1dd6493..ee721de 100644 (file)
@@ -303,11 +303,12 @@ sc_prohibit_atoi_atof:
          $(_sc_search_regexp)
 
 # Use STREQ rather than comparing strcmp == 0, or != 0.
+sp_ = strcmp *\(.+\)
 sc_prohibit_strcmp:
-       @grep -nE '! *str''cmp *\(|\<str''cmp *\(.+\) *[!=]='   \
+       @grep -nE '! *strcmp *\(|\<$(sp_) *[!=]=|[!=]= *$(sp_)'         \
            $$($(VC_LIST_EXCEPT))                                       \
          | grep -vE ':# *define STRN?EQ\(' &&                          \
-         { echo '$(ME): replace str''cmp calls above with STREQ/STRNEQ' \
+         { echo '$(ME): replace strcmp calls above with STREQ/STRNEQ'  \
                1>&2; exit 1; } || :
 
 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)