From 18cb263100a711945c6be3c7bd4682705c6ed750 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Mon, 23 May 2022 15:46:24 +0200 Subject: [PATCH] syntax-check: Improve sc_prohibit_config_h_in_headers check In its current form, the check will not only catch the intended #include but also stuff like #include #include "qemu_interop_config.h" #include The last one is problematic, because it's used in config.h itself. Making the pattern more strict allows us to drop the exception. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 8d30b0e75a..5244d4ee2d 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -694,7 +694,7 @@ sc_prohibit_include_public_headers_brackets: # is only needed in .c files; .h files do not need it since # .c files must include config.h before any other .h. sc_prohibit_config_h_in_headers: - @prohibit='^# *include\>.*config\.h' \ + @prohibit='^# *include *[<"]config\.h' \ in_vc_files='\.h$$' \ halt='headers should not include ' \ $(_sc_search_regexp) @@ -1707,6 +1707,3 @@ exclude_file_name_regexp--sc_prohibit_backslash_alignment = \ exclude_file_name_regexp--sc_prohibit_select = \ ^build-aux/syntax-check\.mk|src/util/vireventglibwatch\.c|tests/meson\.build$$ - -exclude_file_name_regexp--sc_prohibit_config_h_in_headers = \ - ^config\.h$$