bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/4] maint.mk: teach sc_prohibit_magic_number_exit to accept 77


From: Jim Meyering
Subject: [PATCH 2/4] maint.mk: teach sc_prohibit_magic_number_exit to accept 77
Date: Tue, 18 Sep 2012 09:00:10 +0200

From: Jim Meyering <address@hidden>

* top/maint.mk (sc_prohibit_magic_number_exit): Do not complain about
uses like "exit (77)".  "77" is automake's "skip this test" exit code.
It is not in the same category as "exit (0)" or "exit (1)", and
besides, I know of no symbolic name for that 77.  Reported by
Richard W.M. Jones in
http://thread.gmane.org/gmane.comp.emulators.guestfs/1902
---
 ChangeLog    | 10 ++++++++++
 top/maint.mk |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 1279ad3..ce15e28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2012-09-17  Jim Meyering  <address@hidden>

+       maint.mk: teach sc_prohibit_magic_number_exit to accept 77
+       * top/maint.mk (sc_prohibit_magic_number_exit): Do not complain about
+       uses like "exit (77)".  "77" is automake's "skip this test" exit code.
+       It is not in the same category as "exit (0)" or "exit (1)", and
+       besides, I know of no symbolic name for that 77.  Reported by
+       Richard W.M. Jones in
+       http://thread.gmane.org/gmane.comp.emulators.guestfs/1902
+
+2012-09-17  Jim Meyering  <address@hidden>
+
        maint.mk: relax sc_prohibit_strcmp, to avoid a false positive
        * top/maint.mk (sc_prohibit_strcmp): Relax regexp, so as to match
        all uses of #define, not just those that start in column 1.
diff --git a/top/maint.mk b/top/maint.mk
index 09f55c5..9c660a1 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -354,7 +354,7 @@ sc_prohibit_strncpy:
 #      perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
 sc_prohibit_magic_number_exit:
        @prohibit='(^|[^.])\<(usage|exit|error) ?\(-?[0-9]+[,)]'        \
-       exclude='error ?\((0,|[^,]*)'                                   \
+       exclude='exit \(77\)|error ?\(((0|77),|[^,]*)'                  \
        halt='use EXIT_* values rather than magic number'               \
          $(_sc_search_regexp)

-- 
1.7.12.503.g5976753




reply via email to

[Prev in Thread] Current Thread [Next in Thread]