]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Don't include "quotearg.h" when it is not used.
authorJim Meyering <jim@meyering.net>
Wed, 13 Jun 2007 13:33:38 +0000 (15:33 +0200)
committerJim Meyering <jim@meyering.net>
Wed, 13 Jun 2007 13:33:38 +0000 (15:33 +0200)
* Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
* src/cp.c: Don't include "quotearg.h".  It wasn't used.

ChangeLog
Makefile.maint
src/cp.c

index 63a0f04e37abdda146ed9d0b0ebd9844457f7fa0..f48ffddb93a89a610ac54ffee4549d1efa1b9439 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-06-13  Jim Meyering  <jim@meyering.net>
 
+       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.
 
index c4da71e93f9c04682df5aa8820d9f80971caed5a..ba5166b3dddfa2acb0305c6c7ed018fd9fda24e5 100644 (file)
@@ -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)) &&                                  \
index 35c487b9f68d75e0e87df4a86ac1a6199c2a1b2e..3023408db43473eb5b075f667044c93e90ff800a 100644 (file)
--- 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"