[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint.mk: prohibit inclusion of "intprops.h" without_use
From: |
Jim Meyering |
Subject: |
[PATCH] maint.mk: prohibit inclusion of "intprops.h" without_use |
Date: |
Sun, 21 Mar 2010 14:55:12 +0100 |
Another "prohibit header inclusion without use":
>From 8b775146634a9e5614abd5f44bdf9c2225e405ba Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 21 Mar 2010 14:53:34 +0100
Subject: [PATCH] maint.mk: prohibit inclusion of "intprops.h" without_use
* top/maint.mk (sc_prohibit_intprops_without_use): New rule.
---
ChangeLog | 5 +++++
top/maint.mk | 13 +++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d662425..c3176ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-21 Jim Meyering <address@hidden>
+
+ maint.mk: prohibit inclusion of "intprops.h" without_use
+ * top/maint.mk (sc_prohibit_intprops_without_use): New rule.
+
2010-03-20 Bruno Haible <address@hidden>
signal: Undefine macro definitions in C++ mode.
diff --git a/top/maint.mk b/top/maint.mk
index 7d84b6c..d2248d8 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -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 \
--
1.7.0.2.455.g91132
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] maint.mk: prohibit inclusion of "intprops.h" without_use,
Jim Meyering <=