diff top/maint.mk @ 13304:e5593199cd7e

maint.mk: prohibit unwarranted use of <strings.h> * top/maint.mk (sc_prohibit_strings_without_use): Reject inclusion of strings.h in a file that does not also use strcasecmp, strncasecmp, ffs or ffsll.
author Jim Meyering <meyering@redhat.com>
date Mon, 03 May 2010 10:08:20 +0200
parents 38bc4e23ff1e
children 3b72fc82a799
line wrap: on
line diff
--- a/top/maint.mk	Mon May 03 10:07:34 2010 +0200
+++ b/top/maint.mk	Mon May 03 10:08:20 2010 +0200
@@ -544,6 +544,13 @@
 	re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>'		\
 	  $(_sc_header_without_use)
 
+# Prohibit the inclusion of strings.h without a sensible use.
+# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
+sc_prohibit_strings_without_use:
+	@h='<strings.h>'						\
+	re='\<(strn?casecmp|ffs(ll)?)\>'				\
+	  $(_sc_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 =							\