[Libvir] [PATCH] Enable another syntax-check rule.

Jim Meyering jim at meyering.net
Thu Feb 7 18:09:44 UTC 2008


This one makes sure we don't use the "#ifdef HAVE_CONFIG_H" meme:

	Enable another syntax-check rule.
	* Makefile.cfg (local-checks-to-skip): Remove sc_no_have_config_h.
	* qemud/mdns.c: Remove "#ifdef HAVE_CONFIG_H".
	* Makefile.maint (sc_no_have_config_h): Tighten up regexp,
	so that the above mention of "HAVE_CONFIG_H" doesn't match.
	* .x-sc_no_have_config_h: New file, to exempt gnulib/ straggler.

Signed-off-by: Jim Meyering <meyering at redhat.com>
---
 .x-sc_no_have_config_h |    1 +
 Makefile.cfg           |    1 -
 Makefile.maint         |    2 +-
 qemud/mdns.c           |    2 --
 4 files changed, 2 insertions(+), 4 deletions(-)
 create mode 100644 .x-sc_no_have_config_h

diff --git a/.x-sc_no_have_config_h b/.x-sc_no_have_config_h
new file mode 100644
index 0000000..f106267
--- /dev/null
+++ b/.x-sc_no_have_config_h
@@ -0,0 +1 @@
+^gnulib/lib/strsep\.c$
diff --git a/Makefile.cfg b/Makefile.cfg
index 4543ebd..7e8ddcf 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -28,7 +28,6 @@ url_dir_list = \
 local-checks-to-skip =			\
   makefile_path_separator_check		\
   makefile-check			\
-  sc_no_have_config_h			\
   sc_tight_scope			\
   sc_GPL_version			\
   sc_always_defined_macros		\
diff --git a/Makefile.maint b/Makefile.maint
index 8624328..4b54baf 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -96,7 +96,7 @@ sc_file_system:
 	    exit 1; } || :

 sc_no_have_config_h:
-	@grep -n 'HAVE''_CONFIG_H' $$($(CVS_LIST_EXCEPT)) &&		\
+	@grep -n '^# *if.*HAVE''_CONFIG_H' $$($(CVS_LIST_EXCEPT)) &&	\
 	  { echo '$(ME): found use of HAVE''_CONFIG_H; remove'		\
 		1>&2; exit 1; } || :

diff --git a/qemud/mdns.c b/qemud/mdns.c
index deebd07..d47d18e 100644
--- a/qemud/mdns.c
+++ b/qemud/mdns.c
@@ -22,9 +22,7 @@
  * Author: Daniel P. Berrange <berrange at redhat.com>
  */

-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif

 #include <time.h>
 #include <stdio.h>
--
1.5.4.35.g3cfc




More information about the libvir-list mailing list