(syntax-check): Rename from alloc-check.
authorJim Meyering <jim@meyering.net>
Thu, 1 May 2003 13:19:28 +0000 (13:19 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 1 May 2003 13:19:28 +0000 (13:19 +0000)
Also check for SPACE-TAB sequences.
Also check for malloc/calloc/realloc casts.

Makefile.maint

index f62c080..45c7c0d 100644 (file)
@@ -50,19 +50,35 @@ release_archive_dir ?= ../release
 # new ChangeLog entries.
 local-check = \
   po-check copyright-check writable-files m4-check author_mark_check \
-  changelog-check strftime-check xalloc-check makefile_path_separator_check \
+  changelog-check strftime-check syntax-check makefile_path_separator_check \
   makefile-check
 .PHONY: $(local-check)
 
 # Make sure C source files in src/ don't include xalloc.h directly,
 # since they all already include it via sys2.h.
 # It's not a big deal -- just aesthetics.
-xalloc-check:
+syntax-check:
        if test -f $(srcdir)/src/sys2.h; then                           \
          if grep 'xalloc\.h' $(srcdir)/src/*.c; then                   \
            exit 1;                                                     \
          fi;                                                           \
        fi
+       @grep -E '[ ]   ' --exclude=$(srcdir)/lib/regex.c               \
+               $(srcdir)/{lib,src}/*.[chy]                             \
+               $(find -name Makefile.am) &&                            \
+         { echo 'Makefile.maint: found SPACE-TAB sequence; remove the SPACE' \
+               1>&2; \
+           exit 1; } || :
+       @grep -E --exclude=$(srcdir)/lib/regex.c                        \
+           '\*\) *x(m|c|re)alloc\>' $(srcdir)/{lib,src}/*.[chy] &&     \
+         { echo 'Makefile.maint: don'\''t cast x*alloc return value' 1>&2; \
+           exit 1; } || :
+
+#      grep -E '^#  *include <(string|stdlib)\.h>'                     \
+#          $(srcdir)/{lib,src}/*.[chy] &&                              \
+#        { echo 'Makefile.maint: FIXME' 1>&2;                          \
+#          exit 1; } || :
+# FIXME: don't allow `#include .strings\.h' anywhere
 
 # Ensure that date's --help output stays in sync with the info
 # documentation for GNU strftime.  The only exception is %N,