From: Jim Meyering Date: Sun, 23 Jan 2011 17:54:42 +0000 (+0100) Subject: maint.mk: add syntax-check rule: detect unnecessary #include X-Git-Tag: v0.1~3304 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=4cb05a7e8af61822fb9b3627566f41ff38506e4d;p=gnulib.git maint.mk: add syntax-check rule: detect unnecessary #include * top/maint.mk (sc_prohibit_stddef_without_use): New rule. --- diff --git a/ChangeLog b/ChangeLog index 5425c6616..bba6c3531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-01-23 Jim Meyering + + maint.mk: add syntax-check rule: detect unnecessary #include + * top/maint.mk (sc_prohibit_stddef_without_use): New rule. + 2011-01-23 Bruno Haible get-rusage-as: Fix bug. diff --git a/top/maint.mk b/top/maint.mk index 5915814c1..606d42ed1 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -571,6 +571,13 @@ sc_prohibit_intprops_without_use: 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='' \ + 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 \