summaryrefslogtreecommitdiff
path: root/Makefile.maint
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-06-13 15:33:38 +0200
committerJim Meyering <jim@meyering.net>2007-06-13 15:33:38 +0200
commita780166b41f68dbea6d27eea99480708246e7618 (patch)
treee6840a413b64f31940c79e0719f134e9a41e08ea /Makefile.maint
parentae60d5bc4da2f3dca746c21596e03b2bee3db4bd (diff)
downloadcoreutils-a780166b41f68dbea6d27eea99480708246e7618.tar.xz
Don't include "quotearg.h" when it is not used.
* Makefile.maint (sc_prohibit_quotearg_without_use): New rule. * src/cp.c: Don't include "quotearg.h". It wasn't used.
Diffstat (limited to 'Makefile.maint')
-rw-r--r--Makefile.maint12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile.maint b/Makefile.maint
index c4da71e93..ba5166b3d 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -167,6 +167,18 @@ sc_prohibit_assert_without_use:
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 \
+ files=$$(grep -l '# *include "quotearg\.h"' \
+ $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
+ grep -LE '\<quotearg(_[^ ]+)? \(' $$files \
+ | grep . && \
+ { echo "$(ME): the above files include "quotearg.h" but don't use it" \
+ 1>&2; exit 1; } || :; \
+ else :; \
+ fi
+
sc_obsolete_symbols:
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
$$($(CVS_LIST_EXCEPT)) && \