]> Savannah Git Hosting - gnulib.git/commitdiff
maint.mk: fix syntax-check for unnecessary hash.h header use
authorJim Meyering <meyering@fb.com>
Thu, 23 Jun 2022 15:12:44 +0000 (08:12 -0700)
committerJim Meyering <meyering@fb.com>
Thu, 23 Jun 2022 15:12:44 +0000 (08:12 -0700)
* 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
top/maint.mk

index 07580e199a6e64c25f7716a2e66b5131ad7b16ff..5ff33c410c457b8919ae5114937817582f64a809 100644 (file)
--- 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.
index 2740c11d360a70c026800d3fe97a27d89c26cc11..c1fdf9ca2c8cc2d471127e151c2b86e9f80aabed 100644 (file)
@@ -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: