diff options
-rw-r--r-- | libidu/scanners.c | 8 | ||||
-rw-r--r-- | maint.mk | 71 | ||||
-rw-r--r-- | src/fnid.c | 2 | ||||
-rw-r--r-- | src/lid.c | 2 | ||||
-rw-r--r-- | src/xtokid.c | 2 |
5 files changed, 63 insertions, 22 deletions
diff --git a/libidu/scanners.c b/libidu/scanners.c index 92130dc..4a32207 100644 --- a/libidu/scanners.c +++ b/libidu/scanners.c @@ -423,7 +423,7 @@ struct args_c static struct args_c args_c = { 0, ctype_c }; -static struct option const long_options_c[] = +static const struct option const long_options_c[] = { { "keep", required_argument, 0, 'k' }, { "ignore", required_argument, 0, 'i' }, @@ -832,7 +832,7 @@ struct args_asm static struct args_asm args_asm = { 1, 0, ctype_asm }; -static struct option const long_options_asm[] = +static const struct option const long_options_asm[] = { { "comment", required_argument, 0, 'c' }, { "keep", required_argument, 0, 'k' }, @@ -1106,7 +1106,7 @@ struct args_text static struct args_text args_text = { ctype_text }; -static struct option const long_options_text[] = +static const struct option const long_options_text[] = { { "include", required_argument, 0, 'i' }, { "exclude", required_argument, 0, 'x' }, @@ -1310,7 +1310,7 @@ struct args_perl static struct args_perl args_perl = { 1, ctype_perl }; -static struct option const long_options_perl[] = +static const struct option const long_options_perl[] = { { "include", required_argument, 0, 'i' }, { "exclude", required_argument, 0, 'x' }, @@ -144,6 +144,29 @@ sc_error_exit_success: { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \ exit 1; } || : +# `FATAL:' should be fully upper-cased in error messages +# `WARNING:' should be fully upper-cased, or fully lower-cased +sc_error_message_warn_fatal: + @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '"Warning|"Fatal|"fatal' && \ + { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \ + exit 1; } || : + +# Error messages should not start with a capital letter +sc_error_message_uppercase: + @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '"[A-Z]' \ + | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \ + { echo '$(ME): found capitalized error message' 1>&2; \ + exit 1; } || : + +# Error messages should not end with a period +sc_error_message_period: + @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '[^."]\."' && \ + { echo '$(ME): found error message ending in period' 1>&2; \ + exit 1; } || : + sc_file_system: @grep -ni 'file''system' $$($(VC_LIST_EXCEPT)) && \ { echo '$(ME): found use of "file''system";' \ @@ -421,21 +444,14 @@ sc_GPL_version: @grep -n 'either ''version [^3]' $$($(VC_LIST_EXCEPT)) && \ { echo '$(ME): GPL vN, N!=3' 1>&2; exit 1; } || : -exec_perl_re = \ - exec \$$PERL -w -I\$$top_srcdir/tests -MCoreutils \ - -M"CuTmpdir qw(\$$me)" -- - <<\\EOF -# Ensure that each test invoking $PERL with -MCoreutils uses the same line. -sc_perl_coreutils_test: +# Perl-based tests used to exec perl from a #!/bin/sh script. +# Now they all start with #!/usr/bin/perl and the portability +# infrastructure is in tests/Makefile.am. Make sure no old-style +# script sneaks back in. +sc_no_exec_perl_coreutils: @if test -f $(srcdir)/tests/Coreutils.pm; then \ - die=0; \ - for i in $$(grep -l '^exec *\$$PERL.*MCoreutils' \ - $$($(VC_LIST) tests)); do \ - grep '$(exec_perl_re)' $$i > /dev/null \ - && : || { die=1; echo $$i; } \ - done; \ - test $$die = 1 && \ - { echo 1>&2 '$(ME): each of the above execs PERL differently:'; \ - echo 1>&2 '(exit $$fail); exit $$fail'; \ + grep '^exec *\$$PERL.*MCoreutils' $$($(VC_LIST) tests) && \ + { echo 1>&2 '$(ME): found anachronistic Perl-based tests'; \ exit 1; } || :; \ fi @@ -450,6 +466,29 @@ sc_immutable_NEWS: { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \ fi +# Each program that uses proper_name_utf8 must link with +# one of the ICONV libraries. +sc_proper_name_utf8_requires_ICONV: + progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\ + if test "x$$progs" != x; then \ + fail=0; \ + for p in $$progs; do \ + dir=$$(dirname "$$p"); \ + base=$$(basename "$$p" .c); \ + grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \ + || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \ + done; \ + test $$fail = 1 && \ + { echo 1>&2 '$(ME): the above do not link with any ICONV library'; \ + exit 1; } || :; \ + fi + +sc_const_long_option: + @grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \ + | grep -v 'const struct option const' && { \ + echo 1>&2 '$(ME): add "const" to the above declarations'; \ + exit 1; } || : + # Update the hash stored above. Do this after each release and # for any corrections to old entries. update-NEWS-hash: NEWS @@ -689,7 +728,9 @@ endef # the build srcdir, these always-failing programs will run. # Otherwise, it is too easy to test the wrong programs. # Note that "false" itself is a symlink to true, so it too will malfunction. -my-distcheck: $(DIST_ARCHIVES) $(local-check) check +my-distcheck: $(DIST_ARCHIVES) $(local-check) + $(MAKE) syntax-check + $(MAKE) check -rm -rf $(t) mkdir -p $(t) GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz @@ -55,7 +55,7 @@ usage (void) exit (1); } -static struct option const long_options[] = +static const struct option const long_options[] = { { "file", required_argument, 0, 'f' }, { "separator", required_argument, 0, 'S' }, @@ -211,7 +211,7 @@ static unsigned int frequency_high = USHRT_MAX; static struct file_link *cw_dlink; static struct file_link **members_0; -static struct option const long_options[] = +static const struct option const long_options[] = { { "file", required_argument, 0, 'f' }, { "frequency", required_argument, 0, 'F' }, diff --git a/src/xtokid.c b/src/xtokid.c index 36aa356..c7f67aa 100644 --- a/src/xtokid.c +++ b/src/xtokid.c @@ -51,7 +51,7 @@ usage (void) exit (1); } -static struct option const long_options[] = +static const struct option const long_options[] = { { "include", required_argument, 0, 'i' }, { "exclude", required_argument, 0, 'x' }, |