[PATCH 3/6] syntax-check: Remove used header checks for gnulib modules

Peter Krempa pkrempa at redhat.com
Wed Mar 31 09:34:26 UTC 2021


We removed gnulib support, so all the checks whether a header is
included only when it's used are pointless now.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 build-aux/syntax-check.mk | 96 ---------------------------------------
 1 file changed, 96 deletions(-)

diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index b03441d4cd..c1134d6a02 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -1415,97 +1415,10 @@ endef
 sc_prohibit_assert_without_use:
 	@h='assert.h' re='\<assert *\(' $(_sc_header_without_use)

-# Prohibit the inclusion of close-stream.h without an actual use.
-sc_prohibit_close_stream_without_use:
-	@h='close-stream.h' re='\<close_stream *\(' $(_sc_header_without_use)
-
 # Prohibit the inclusion of getopt.h without an actual use.
 sc_prohibit_getopt_without_use:
 	@h='getopt.h' re='\<getopt(_long)? *\(' $(_sc_header_without_use)

-# Don't include this header unless you use one of its functions.
-sc_prohibit_long_options_without_use:
-	@h='long-options.h' re='\<parse_(long_options|gnu_standard_options_only) *\(' \
-	  $(_sc_header_without_use)
-
-# Don't include this header unless you use one of its functions.
-sc_prohibit_inttostr_without_use:
-	@h='inttostr.h' re='\<(off|[iu]max|uint)tostr *\(' \
-	  $(_sc_header_without_use)
-
-# Don't include this header unless you use one of its functions.
-sc_prohibit_ignore_value_without_use:
-	@h='ignore-value.h' re='\<ignore_(value|ptr) *\(' \
-	  $(_sc_header_without_use)
-
-# Don't include this header unless you use one of its functions.
-sc_prohibit_error_without_use:
-	@h='error.h' \
-	re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
-	  $(_sc_header_without_use)
-
-# Don't include xalloc.h unless you use one of its functions.
-# Consider these symbols:
-# perl -lne '/^# *define (\w+)\(/ and print $1' lib/xalloc.h|grep -v '^__';
-# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/xalloc.h
-# Divide into two sets on case, and filter each through this:
-# | sort | perl -MRegexp::Assemble -le \
-#  'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g'
-# Note this was produced by the above:
-# _xa1 = \
-#x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup)
-# But we can do better, in at least two ways:
-# 1) take advantage of two "dup"-suffixed strings:
-# x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup)
-# 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable
-# "char|[cmz]"
-# x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
-_xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
-_xa2 = X([CZ]|N?M)ALLOC
-sc_prohibit_xalloc_without_use:
-	@h='xalloc.h' \
-	re='\<($(_xa1)|$(_xa2)) *\('\
-	  $(_sc_header_without_use)
-
-sc_prohibit_cloexec_without_use:
-	@h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \
-	  $(_sc_header_without_use)
-
-sc_prohibit_posixver_without_use:
-	@h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
-
-sc_prohibit_same_without_use:
-	@h='same.h' re='\<same_name(at)? *\(' $(_sc_header_without_use)
-
-sc_prohibit_hash_pjw_without_use:
-	@h='hash-pjw.h' \
-	re='\<hash_pjw\>' \
-	  $(_sc_header_without_use)
-
-sc_prohibit_safe_read_without_use:
-	@h='safe-read.h' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
-	  $(_sc_header_without_use)
-
-sc_prohibit_argmatch_without_use:
-	@h='argmatch.h' \
-	re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
-	  $(_sc_header_without_use)
-
-sc_prohibit_canonicalize_without_use:
-	@h='canonicalize.h' \
-	re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode|file_name)' \
-	  $(_sc_header_without_use)
-
-sc_prohibit_root_dev_ino_without_use:
-	@h='root-dev-ino.h' \
-	re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
-	  $(_sc_header_without_use)
-
-sc_prohibit_openat_without_use:
-	@h='openat.h' \
-	re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat|(FCHMOD|FCHOWN|STAT)AT_INLINE)\>' \
-	  $(_sc_header_without_use)
-
 # The following list was generated by running:
 # man signal.h|col -b|perl -ne '/bsd_signal.*;/.../sigwaitinfo.*;/ and print' \
 #   | perl -lne '/^\s+(?:int|void).*?(\w+).*/ and print $1' | fmt
@@ -1546,11 +1459,6 @@ sc_prohibit_stdio--_without_use:
 	@h='stdio--.h' re='\<((f(re)?|p)open|tmpfile) *\('		\
 	  $(_sc_header_without_use)

-# Don't include stdio-safer.h unless you use one of its functions.
-sc_prohibit_stdio-safer_without_use:
-	@h='stdio-safer.h' re='\<((f(re)?|p)open|tmpfile)_safer *\('	\
-	  $(_sc_header_without_use)
-
 # Prohibit the inclusion of strings.h without a sensible use.
 # Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
 sc_prohibit_strings_without_use:
@@ -1576,10 +1484,6 @@ sc_prohibit_dirent_without_use:
 	re='\<($(_dirent_syms_re))\>'					\
 	  $(_sc_header_without_use)

-# Don't include xfreopen.h unless you use one of its functions.
-sc_prohibit_xfreopen_without_use:
-	@h='xfreopen.h' re='\<xfreopen *\(' $(_sc_header_without_use)
-
 # Ensure that each .c file containing a "main" function also
 # calls bindtextdomain.
 sc_bindtextdomain:
-- 
2.29.2




More information about the libvir-list mailing list