From 852e4225aff4b304fec445ee322f8cf4a001675a Mon Sep 17 00:00:00 2001 From: Bernhard Voelker
Date: Sun, 27 Dec 2015 22:57:47 +0100 Subject: [PATCH 1/2] maint: avoid syntax-check failures To: address@hidden * Makefile.am (gen-ChangeLog): Replace 8 spaces by a tab to avoid sc_makefile_TAB_only_indentation failure. * po/POTFILES.in: Remove some entries to let sc_po_check pass. While at it, sort the entries. * find/print.c (do_fprintf): Remove stray semicolon to let sc_prohibit_double_semicolon pass. * find/util.c (digest_mode): Likewise. * bootstrap.conf: Change comment to let sc_prohibit_doubled_word pass. * build-aux/git-log-fix: Remove empty lines at EOF to let sc_prohibit_empty_lines_at_EOF pass. * find/testsuite/Makefile.am: Likewise. * find/testsuite/sv-34079.sh: Likewise. * find/testsuite/test_inode.sh: Likewise. * locate/testsuite/locate.gnu/slocate.exp: Likewise. * lib/buildcmd.c: Remove unused include of openat header to let sc_prohibit_openat_without_use pass. * lib/listfile.c: Likewise. * find/util.c: Remove unused include of 'verify.h' to let sc_prohibit_verify_without_use pass. * xargs/xargs.c: Likewise. * find/parser.c (insert_regex): Mark error diagnostic for translation; found by 'make sc_unmarked_diagnostics'. * cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Exempt the 2 remaining sources using the possibly dangerous strncpy function from the syntax-check. --- Makefile.am | 2 +- bootstrap.conf | 2 +- build-aux/git-log-fix | 1 - cfg.mk | 3 +++ find/parser.c | 3 ++- find/print.c | 2 +- find/testsuite/Makefile.am | 2 -- find/testsuite/sv-34079.sh | 1 - find/testsuite/test_inode.sh | 3 --- find/util.c | 3 +-- lib/buildcmd.c | 1 - lib/listfile.c | 1 - locate/testsuite/locate.gnu/slocate.exp | 1 - po/POTFILES.in | 31 ++----------------------------- xargs/xargs.c | 1 - 15 files changed, 11 insertions(+), 46 deletions(-) diff --git a/Makefile.am b/Makefile.am index af82d54..6d6d83c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,7 +44,7 @@ gen-ChangeLog: && cat $(top_srcdir)/ChangeLog-2013 ; \ } > $(distdir)/cl-t \ && { rm -f $(distdir)/ChangeLog \ - && mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ + && mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ else \ echo "WARNING: $@: cannot generate ChangeLog since" >&2 && \ echo "$(top_srcdir) has no .git subdirectory" >&2 ; \ diff --git a/bootstrap.conf b/bootstrap.conf index 5617046..987838a 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -187,7 +187,7 @@ m4_base=gl/m4 # 'libgnulib' is mentioned in various 'Makefile.am' files. gnulib_name=libgnulib -# PO files are checked-in in findutils, don't auto-update. +# PO files are committed to findutils, don't auto-update. SKIP_PO=t diff --git a/build-aux/git-log-fix b/build-aux/git-log-fix index 0447b4a..80628dd 100644 --- a/build-aux/git-log-fix +++ b/build-aux/git-log-fix @@ -46,4 +46,3 @@ s,(find),* $1, 1d6d1afa52f40ad7c776e3ff0d4415409377e6fb s/Mark/* po\/POTFILES.in: mark/; s/(translation)/$1./ - diff --git a/cfg.mk b/cfg.mk index 84f395e..797731e 100644 --- a/cfg.mk +++ b/cfg.mk @@ -46,6 +46,9 @@ exclude_file_name_regexp--sc_prohibit_doubled_word = \ exclude_file_name_regexp--sc_program_name = \ ^lib/test_splitstring\.c$$ +# Suppress syntax-check failure regarding possibly evil strncpy use for now. +exclude_file_name_regexp--sc_prohibit_strncpy = ^(find/print.c|lib/buildcmd.c)$$ + # sc_texinfo_acronym: perms.texi from coreutils uses @acronym{GNU}. exclude_file_name_regexp--sc_texinfo_acronym = doc/perm\.texi diff --git a/find/parser.c b/find/parser.c index eb8bc99..b57cdda 100644 --- a/find/parser.c +++ b/find/parser.c @@ -2124,7 +2124,8 @@ insert_regex (char **argv, error_message = re_compile_pattern (rx, strlen (rx), re); if (error_message) - error (EXIT_FAILURE, 0, "failed to compile regular expression '%s': %s", + error (EXIT_FAILURE, 0, + _("failed to compile regular expression '%s': %s"), rx, error_message); our_pred->est_success_rate = estimate_pattern_match_rate (rx, 1); return true; diff --git a/find/print.c b/find/print.c index 6973426..e4c28ad 100644 --- a/find/print.c +++ b/find/print.c @@ -1132,7 +1132,7 @@ do_fprintf (struct format_val *dest, case 'S': /* sparseness */ /* UNTRUSTED, probably unexploitable */ - checked_fprintf (dest, segment->text, file_sparseness (stat_buf));; + checked_fprintf (dest, segment->text, file_sparseness (stat_buf)); break; case 't': /* mtime in `ctime' format */ diff --git a/find/testsuite/Makefile.am b/find/testsuite/Makefile.am index fac8f2c..c1369c3 100644 --- a/find/testsuite/Makefile.am +++ b/find/testsuite/Makefile.am @@ -281,5 +281,3 @@ configured-testfiles.txt: Makefile checklists: configured-testfiles.txt Makefile $(PYTHON) $(srcdir)/checklists.py configured-testfiles.txt $(srcdir) config find.gnu find.posix - - diff --git a/find/testsuite/sv-34079.sh b/find/testsuite/sv-34079.sh index 928a9af..8abbc26 100755 --- a/find/testsuite/sv-34079.sh +++ b/find/testsuite/sv-34079.sh @@ -76,4 +76,3 @@ else echo "${testname} was not run because" '${RUN_VERY_EXPENSIVE_TESTS}' \ "is unset." fi - diff --git a/find/testsuite/test_inode.sh b/find/testsuite/test_inode.sh index ea097d8..9c3cb88 100755 --- a/find/testsuite/test_inode.sh +++ b/find/testsuite/test_inode.sh @@ -60,6 +60,3 @@ if tmpfile=$(mktemp); then fi rm -f "${tmpfile}" fi - - - diff --git a/find/util.c b/find/util.c index 0560e63..5ffe140 100644 --- a/find/util.c +++ b/find/util.c @@ -38,7 +38,6 @@ #include "quotearg.h" #include "save-cwd.h" #include "timespec.h" -#include "verify.h" #include "xalloc.h" /* find headers. */ @@ -728,7 +727,7 @@ digest_mode (mode_t *mode, if (leaf) { state.have_stat = false; - state.have_type = false;; + state.have_type = false; state.type = 0; } else diff --git a/lib/buildcmd.c b/lib/buildcmd.c index 2616ed6..a58f67e 100644 --- a/lib/buildcmd.c +++ b/lib/buildcmd.c @@ -24,7 +24,6 @@ #include