From: Jim Meyering Date: Sun, 10 Feb 2008 16:18:03 +0000 (+0100) Subject: Ensure there are no removable (useless) if-before-free tests. X-Git-Tag: v6.11~151 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2746a6c05c384a3d5eab192ecd151cb97a85b181;p=thirdparty%2Fcoreutils.git Ensure there are no removable (useless) if-before-free tests. * bootstrap.conf (gnulib_modules): Add useless-if-before-free. * Makefile.maint (sc_avoid_if_before_free): New rule. --- diff --git a/Makefile.maint b/Makefile.maint index 3fbfa422b6..6d280ff43d 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -101,6 +101,13 @@ syntax-check: $(local-check) # exit 1; } || : # FIXME: don't allow `#include .strings\.h' anywhere +sc_avoid_if_before_free: + @$(srcdir)/build-aux/useless-if-before-free \ + $(useless_free_options) \ + $$($(CVS_LIST_EXCEPT)) && \ + { echo '$(ME): found useless "if" before "free" above' 1>&2; \ + exit 1; } || : + sc_cast_of_argument_to_free: @grep -nE '\&2; \ diff --git a/bootstrap.conf b/bootstrap.conf index bd76ba7317..245287248f 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -82,7 +82,9 @@ gnulib_modules=" strftime strpbrk strtoimax strtoumax strverscmp sys_stat timespec tzset unicodeio unistd-safer unlink-busy unlinkdir unlocked-io - uptime userspec utimecmp utimens + uptime + useless-if-before-free + userspec utimecmp utimens vasprintf-posix vc-list-files verify version-etc-fsf