From 9a93371caac4a9440c41d3269b21db585920e4c4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 14 Nov 2009 09:53:26 +0100 Subject: [PATCH] maint.mk: Prohibit inclusion of "xalloc.h" without use. * top/maint.mk (sc_prohibit_close_stream_without_use): New rule. --- ChangeLog | 5 +++++ top/maint.mk | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index e23f2856f5..c821d8dfef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-14 Jim Meyering + + maint.mk: Prohibit inclusion of "xalloc.h" without use. + * top/maint.mk (sc_prohibit_close_stream_without_use): New rule. + 2009-11-14 John W. Eaton strftime.h: wrap funtion declaration in extern "C" block diff --git a/top/maint.mk b/top/maint.mk index 73ea8eaec1..34d66e1d14 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -289,6 +289,23 @@ sc_prohibit_error_without_use: re='\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) +_xa2 = X([CZ]|N?M)ALLOC +sc_prohibit_xalloc_without_use: + @h='"xalloc.h"' \ + re='\<($(_xa1)|$(_xa2)) *\('\ + $(_header_without_use) + sc_prohibit_safe_read_without_use: @h='"safe-read.h"' re='(\|\