diff top/maint.mk @ 14216:676f66180a36

maint.mk: add syntax-check rule: detect unnecessary #include <stddef.h> * top/maint.mk (sc_prohibit_stddef_without_use): New rule.
author Jim Meyering <meyering@redhat.com>
date Sun, 23 Jan 2011 18:54:42 +0100
parents 59d4ae9d48d6
children e52d28567d4e
line wrap: on
line diff
--- a/top/maint.mk	Sun Jan 23 18:58:10 2011 +0100
+++ b/top/maint.mk	Sun Jan 23 18:54:42 2011 +0100
@@ -571,6 +571,13 @@
 	re='\<($(_intprops_syms_re)) *\('				\
 	  $(_sc_header_without_use)
 
+_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
+# Prohibit the inclusion of stddef.h without an actual use.
+sc_prohibit_stddef_without_use:
+	@h='<stddef.h>'							\
+	re='\<($(_stddef_syms_re)) *\('					\
+	  $(_sc_header_without_use)
+
 sc_obsolete_symbols:
 	@prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>'			\
 	halt='do not use HAVE''_FCNTL_H or O'_NDELAY			\