From 04354518e1b36ede5e63c2d80814601e4d6d307a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 28 Dec 2005 10:26:10 +0000 Subject: [PATCH] (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). --- Makefile.maint | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile.maint b/Makefile.maint index 27a23bf..ddb6bff 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 -# #endif - sc_cast_of_argument_to_free: @grep -E '\&2; \ @@ -174,11 +169,21 @@ sc_require_config_h: { echo '$(ME): the above files do not include ' \ 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 '\' \ + $$($(CVS_LIST) | grep '\.c$$' | grep -vEf .x-$@ )) \ + | grep . && \ + { echo "$(ME): the above files include 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 -- 2.7.4