From: Jim Meyering Date: Sat, 15 Mar 2008 16:53:00 +0000 (+0100) Subject: Prohibit inclusion of getopt.h without use. X-Git-Tag: v6.11~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ecdb0a52a80d0fd5d2c448b6cab8276e9934c81;p=thirdparty%2Fcoreutils.git Prohibit inclusion of getopt.h without use. * Makefile.maint (sc_prohibit_getopt_without_use): New rule. --- diff --git a/Makefile.maint b/Makefile.maint index de49669b8c..7a0157ba7f 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -178,6 +178,18 @@ sc_prohibit_assert_without_use: else :; \ fi +# Prohibit the inclusion of getopt.h without an actual use. +sc_prohibit_getopt_without_use: + @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ + files=$$(grep -l '# *include ' \ + $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \ + grep -E -L '\ but don't use it" \ + 1>&2; exit 1; } || :; \ + else :; \ + fi + # Don't include quotearg.h unless you use one of its functions. sc_prohibit_quotearg_without_use: @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \