Ensure there are no removable (useless) if-before-free tests.
authorJim Meyering <meyering@redhat.com>
Sun, 10 Feb 2008 16:18:03 +0000 (17:18 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 10 Feb 2008 16:18:03 +0000 (17:18 +0100)
* bootstrap.conf (gnulib_modules): Add useless-if-before-free.
* Makefile.maint (sc_avoid_if_before_free): New rule.

Makefile.maint
bootstrap.conf

index 3fbfa42..6d280ff 100644 (file)
@@ -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 '\<free \(\(' $$($(CVS_LIST_EXCEPT)) &&               \
          { echo '$(ME): don'\''t cast free argument' 1>&2;             \
index bd76ba7..2452872 100644 (file)
@@ -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