bug-gnulib
[Top][All Lists]
Advanced

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

FYI, fix the hash.h inclusion-not-needed syntax-check rule


From: Jim Meyering
Subject: FYI, fix the hash.h inclusion-not-needed syntax-check rule
Date: Thu, 23 Jun 2022 08:42:07 -0700

FYI, I've just pushed this fix for the hash.h syntax-check rule:

>From fc555c0a4bf23b3418e0e9cc3a0800172b716b90 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Thu, 23 Jun 2022 08:12:44 -0700
Subject: [PATCH] maint.mk: fix syntax-check for unnecessary hash.h header use

* top/maint.mk (_hash_re): Correct the regexp. It had two problems:
- lacked the "hash_" prefix, so would match non-uses
- failed to detect uses of the hash_x?initialize functions
The former led to an excess/unneeded use of hash.h in coreutils' cut.c.
The latter would have led to a FP "not needed" report for copy.c.
---
 ChangeLog    | 9 +++++++++
 top/maint.mk | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 07580e199a..5ff33c410c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-06-23  Jim Meyering  <meyering@fb.com>
+
+       maint.mk: fix syntax-check for unnecessary hash.h header use
+       * top/maint.mk (_hash_re): Correct the regexp. It had two problems:
+       - lacked the "hash_" prefix, so would match non-uses
+       - failed to detect uses of the hash_x?initialize functions
+       The former led to an excess/unneeded use of hash.h in coreutils' cut.c.
+       The latter would have led to a FP "not needed" report for copy.c.
+
 2022-06-22  Bruno Haible  <bruno@clisp.org>

        fchmodat: Fix test failure on native Windows.
diff --git a/top/maint.mk b/top/maint.mk
index 2740c11d36..c1fdf9ca2c 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -622,9 +622,9 @@ sc_prohibit_xalloc_without_use:
          $(_sc_header_without_use)

 # Extract function names:
-# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/hash.h
+# perl -lne '/^(?:extern )?(?:void|char|Hash_table) \*?(\w+) *\(/ and print 
$1' lib/hash.h
 _hash_re = \
-clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning
+hash_(re(set_tuning|move)|xin(itialize|sert)|in(itialize|sert)|get_(firs|nex)t|print_statistics|(delet|fre)e|lookup|clear)
 _hash_fn = \<($(_hash_re)) *\(
 _hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
 sc_prohibit_hash_without_use:
-- 
2.35.1.677.gabf474a5dd


reply via email to

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