maint.mk: prohibit inclusion of "intprops.h" without use
authorJim Meyering <meyering@redhat.com>
Sun, 21 Mar 2010 13:53:34 +0000 (14:53 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 21 Mar 2010 19:45:49 +0000 (20:45 +0100)
* top/maint.mk (sc_prohibit_intprops_without_use): New rule.

ChangeLog
top/maint.mk

index a5acf2faaac2cafcb76eeecfc457c156503faacd..92faf920ee26ed68506f37447aa70457bf95529a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-21  Jim Meyering  <meyering@redhat.com>
+
+       maint.mk: prohibit inclusion of "intprops.h" without use
+       * top/maint.mk (sc_prohibit_intprops_without_use): New rule.
+
 2010-03-21  Bruno Haible  <bruno@clisp.org>
 
        New module 'grantpt'.
index 7d84b6c3b58a1410810a505e387b7dedfb12d806..d2248d8faf3a8fb67ec1520e46a165ee5c4615ca 100644 (file)
@@ -452,6 +452,19 @@ sc_prohibit_signal_without_use:
        re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>'          \
          $(_header_without_use)
 
+# Get the list of symbol names with this:
+# perl -lne '/^# *define (\w+)\(/ and print $1' lib/intprops.h|grep -v '^s'|fmt
+_intprops_names =                                                      \
+  TYPE_IS_INTEGER TYPE_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT            \
+  TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM          \
+  INT_STRLEN_BOUND INT_BUFSIZE_BOUND
+_intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names)))
+# Prohibit the inclusion of intprops.h without an actual use.
+sc_prohibit_intprops_without_use:
+       @h='"intprops.h"'                                               \
+       re='\<($(_intprops_syms_re)) *\('                               \
+         $(_header_without_use)
+
 sc_obsolete_symbols:
        @re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>'                           \
        msg='do not use HAVE''_FCNTL_H or O'_NDELAY                     \