From 975243c9fb21ec51e9cc59db68626a800be78abd Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 29 Oct 2009 07:29:26 -0600 Subject: [PATCH] maint: detect usage(1) and other suspicious exits * top/maint.mk (sc_prohibit_magic_number_exit): New rule. Signed-off-by: Eric Blake --- ChangeLog | 5 +++++ top/maint.mk | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index b2073ee7b1..b0c83b8a8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-29 Eric Blake + + maint: detect usage(1) and other suspicious exits + * top/maint.mk (sc_prohibit_magic_number_exit): New rule. + 2009-10-29 Jim Meyering timespec: long-to-int truncation could make timespec_cmp malfunction diff --git a/top/maint.mk b/top/maint.mk index 68bd8f9153..996344a93d 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -156,6 +156,12 @@ sc_prohibit_strcmp: { echo '$(ME): use STREQ in place of the above uses of str''cmp' \ 1>&2; exit 1; } || : +# Pass EXIT_*, not number, to usage, exit, and error (when exiting) +sc_prohibit_magic_number_exit: + @re='\<(usage|exit) ?\([0-9]|\