summaryrefslogtreecommitdiff
path: root/Makefile.maint
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-05-01 13:19:28 +0000
committerJim Meyering <jim@meyering.net>2003-05-01 13:19:28 +0000
commit84ddd12f18223b5295cc5be1183acb6b061cb8cb (patch)
tree2d76b4dcbee112dbd5189a3038e9479d2886e435 /Makefile.maint
parent7968d80a80e953c7ce60687dceeb27ba58cd8b72 (diff)
downloadcoreutils-84ddd12f18223b5295cc5be1183acb6b061cb8cb.tar.xz
(syntax-check): Rename from alloc-check.
Also check for SPACE-TAB sequences. Also check for malloc/calloc/realloc casts.
Diffstat (limited to 'Makefile.maint')
-rw-r--r--Makefile.maint20
1 files changed, 18 insertions, 2 deletions
diff --git a/Makefile.maint b/Makefile.maint
index f62c080e0..45c7c0d99 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,