# HG changeset patch # User Jim Meyering # Date 1262700735 -3600 # Node ID 51b39cac47f1bde8e101a65a2c16943ed43378c8 # Parent 7b84f51e4373739b42ba4a476a7e692fcc9cdc38 maint.mk: include 4 more function names in alloca.h-checking regexp * top/maint.mk (sc_prohibit_xalloc_without_use): Use more complete regexp. Before, we would give a false-positive (saying alloca.h is included unnecessarily) when the only uses involved omitted symbols. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-01-05 Jim Meyering + maint.mk: include 4 more function names in alloca.h-checking regexp + * top/maint.mk (sc_prohibit_xalloc_without_use): Use more complete + regexp. Before, we would give a false-positive (saying alloca.h + is included unnecessarily) when the only uses involved omitted symbols. + xalloc.h: use consistent formatting * lib/xalloc.h: Move declarations to start in the first column. diff --git a/top/maint.mk b/top/maint.mk --- a/top/maint.mk +++ b/top/maint.mk @@ -324,9 +324,15 @@ # | sort | perl -MRegexp::Assemble -le \ # 'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g' # Note this was produced by the above: -# _xa1 = x(alloc_(oversized|die)|([cz]|2?re)alloc|m(alloc|emdup)|strdup) -# But we can do better: -_xa1 = x(alloc_(oversized|die)|([cmz]|2?re)alloc|(mem|str)dup) +# _xa1 = \ +#x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup) +# But we can do better, in at least two ways: +# 1) take advantage of two "dup"-suffixed strings: +# x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup) +# 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable +# "char|[cmz]" +# x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup) +_xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup) _xa2 = X([CZ]|N?M)ALLOC sc_prohibit_xalloc_without_use: @h='"xalloc.h"' \