From: Jim Meyering Date: Thu, 1 May 2003 13:19:28 +0000 (+0000) Subject: (syntax-check): Rename from alloc-check. X-Git-Tag: v5.0.1~639 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=84ddd12f18223b5295cc5be1183acb6b061cb8cb;p=thirdparty%2Fcoreutils.git (syntax-check): Rename from alloc-check. Also check for SPACE-TAB sequences. Also check for malloc/calloc/realloc casts. --- diff --git a/Makefile.maint b/Makefile.maint index f62c080e05..45c7c0d990 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -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,