# HG changeset patch # User Jim Meyering # Date 1272874100 -7200 # Node ID e5593199cd7e47c03c80e9da2d446a0d98aba047 # Parent 522a26cf44a2a215d082395f6a6b8fadcd6ca65d maint.mk: prohibit unwarranted use of * 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. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ 2010-05-03 Jim Meyering + maint.mk: prohibit unwarranted use of + * 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. + maint.mk: remove obsolete comments * top/maint.mk: Remove stale, commented-out rules. diff --git a/top/maint.mk b/top/maint.mk --- a/top/maint.mk +++ b/top/maint.mk @@ -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='' \ + 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 = \