From: Jim Meyering Date: Wed, 13 Jun 2007 13:33:38 +0000 (+0200) Subject: Don't include "quotearg.h" when it is not used. X-Git-Tag: v6.9.89~269 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a780166b41f68dbea6d27eea99480708246e7618;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/ChangeLog b/ChangeLog index 63a0f04e37..f48ffddb93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-06-13 Jim Meyering + 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. + * README-hacking: List Gperf as a build-requirement, too. Reported by Steve Ward. diff --git a/Makefile.maint b/Makefile.maint index c4da71e93f..ba5166b3dd 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 '\&2; exit 1; } || :; \ + else :; \ + fi + sc_obsolete_symbols: @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \ $$($(CVS_LIST_EXCEPT)) && \ diff --git a/src/cp.c b/src/cp.c index 35c487b9f6..3023408db4 100644 --- a/src/cp.c +++ b/src/cp.c @@ -32,7 +32,6 @@ #include "filenamecat.h" #include "lchmod.h" #include "quote.h" -#include "quotearg.h" #include "stat-time.h" #include "utimens.h" #include "acl.h"