bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint.mk: prohibit inclusion of "hash.h" without_use


From: Jim Meyering
Subject: [PATCH] maint.mk: prohibit inclusion of "hash.h" without_use
Date: Sun, 14 Feb 2010 11:28:49 +0100

I spotted three more unnecessary #include directives in coreutils'
remove.c, so here's as syntax-check rule that would have detected one
of them:

>From e1b83155bc5e95f4165b806850e4117426479a68 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 14 Feb 2010 11:22:29 +0100
Subject: [PATCH] maint.mk: prohibit inclusion of "hash.h" without_use

* top/maint.mk (sc_prohibit_hash_without_use): New rule.
---
 ChangeLog    |    5 +++++
 top/maint.mk |   11 +++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c382d58..0ebee71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-14  Jim Meyering  <address@hidden>
+
+       maint.mk: prohibit inclusion of "hash.h" without_use
+       * top/maint.mk (sc_prohibit_hash_without_use): New rule.
+
 2010-02-10  Jim Meyering  <address@hidden>

        maint.mk: prohibit inclusion of "ignore-value.h" without_use
diff --git a/top/maint.mk b/top/maint.mk
index ed8d367..a623d02 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -367,6 +367,17 @@ sc_prohibit_xalloc_without_use:
        re='\<($(_xa1)|$(_xa2)) *\('\
          $(_header_without_use)

+# Extract function names:
+# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) \(/ and print $1' lib/hash.h
+_hash_re = \
+clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning
+_hash_fn = \<($(_hash_re)) *\(
+_hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
+sc_prohibit_hash_without_use:
+       h='"hash.h"' \
+       re='$(_hash_fn)|$(_hash_struct)'\
+         $(_header_without_use)
+
 sc_prohibit_safe_read_without_use:
        @h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
          $(_header_without_use)
--
1.7.0.169.g57c99




reply via email to

[Prev in Thread] Current Thread [Next in Thread]