summaryrefslogtreecommitdiff
path: root/Makefile.maint
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-12-28 10:26:10 +0000
committerJim Meyering <jim@meyering.net>2005-12-28 10:26:10 +0000
commit04354518e1b36ede5e63c2d80814601e4d6d307a (patch)
tree3f1aac1aedeb88c3b77a304d34dac4f25c3cfe67 /Makefile.maint
parent67e065e79d5858e5959578e94e2b161b4b5c24dc (diff)
downloadcoreutils-04354518e1b36ede5e63c2d80814601e4d6d307a.tar.xz
(sc_obsolete_symbols): Prohibit use of O_NDELAY.
(sc_prohibit_assert_without_use): New rule. (syntax-check-rules): Add it to the list. (CVS_LIST): Define in terms of $(srcdir).
Diffstat (limited to 'Makefile.maint')
-rw-r--r--Makefile.maint23
1 files changed, 14 insertions, 9 deletions
diff --git a/Makefile.maint b/Makefile.maint
index 27a23bf3c..ddb6bff25 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -29,7 +29,7 @@ GZIP_ENV = '--no-name --best --rsyncable'
CVS = cvs
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
-CVS_LIST = build-aux/cvsu --find --types=AFGM
+CVS_LIST = $(srcdir)/build-aux/cvsu --find --types=AFGM
ifeq ($(origin prev_version_file), undefined)
prev_version_file = .prev-version
@@ -80,6 +80,7 @@ syntax-check-rules = \
sc_obsolete_symbols \
sc_prohibit_atoi_atof \
sc_prohibit_jm_in_m4 \
+ sc_prohibit_assert_without_use \
sc_require_config_h \
sc_root_tests \
sc_space_tab \
@@ -102,12 +103,6 @@ syntax-check: $(syntax-check-rules)
# exit 1; } || :
# FIXME: don't allow `#include .strings\.h' anywhere
-# FIXME: add a check for this.
-# Nearly every lib/*.c file must include config.h, like this:
-# #ifdef HAVE_CONFIG_H
-# # include <config.h>
-# #endif
-
sc_cast_of_argument_to_free:
@grep -E '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
@@ -174,11 +169,21 @@ sc_require_config_h:
{ echo '$(ME): the above files do not include <config.h>' \
1>&2; exit 1; } || :
+# Prohibit the inclusion of assert.h without an actual use of assert.
+sc_prohibit_assert_without_use:
+ @( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
+ grep -L '\<assert (' \
+ $$(grep -l '# *include <assert\.h>' \
+ $$($(CVS_LIST) | grep '\.c$$' | grep -vEf .x-$@ )) \
+ | grep . && \
+ { echo "$(ME): the above files include <assert.h> but don't use it" \
+ 1>&2; exit 1; } || :
+
sc_obsolete_symbols:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
- grep -E '\<(HAVE_FCNTL_H)\>' \
+ grep -E '\<(HAVE_FCNTL_H|O_NDELAY)\>' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
- { echo '$(ME): do not use HAVE_FCNTL_H' \
+ { echo '$(ME): do not use HAVE_FCNTL_H or O_NDELAY' \
1>&2; exit 1; } || :
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ