package: various fixes for syntax-check

* cfg.mk: Disable checks where needed (e.g., we do want to check the
behavior with tabs).
(sc_at_parser_check): Remove.  Unfortunately since
a11c144609 we no longer use the './'
prefix to run programs in the current directory.  That was so that we
could run Java programs like the other, although they are no run with
the `./` prefix (see 967a59d2c0).
As a consequence this sc check no longer makes sense.
However, since now AT_PARSER_CHECK passes the `./` prefix itself, this
sc-check was superfluous.
* examples/c/reccalc/scan.l: Use memcpy, not strncpy.
* src/ielr.c, src/reader.c: Obfuscate "lr(0)" so that the sc-check for
"space before paren" does not fire.
* tests/diagnostics.at: Avoid space-tab, use tab-tab.
This commit is contained in:
Akim Demaille
2019-04-27 19:11:59 +02:00
parent 33b246a624
commit 57290d63fd
7 changed files with 14 additions and 21 deletions

21
cfg.mk
View File

@@ -60,18 +60,6 @@ update-copyright-env = \
## More syntax-checks. ##
## -------------------- ##
# At least for Mac OS X's grep, the order between . and [ in "[^.[]"
# matters:
# $ LC_ALL=fr_FR grep -nE '[^[.]' /dev/null
# $ LC_ALL=C grep -nE '[^[.]' /dev/null
# grep: invalid collating element or class
# $ LC_ALL=fr_FR grep -nE '[^.[]' /dev/null
# $ LC_ALL=C grep -nE '[^.[]' /dev/null
sc_at_parser_check:
@prohibit='AT_PARSER_CHECK\(\[+[^.[]|AT_CHECK\(\[+\./' \
halt='use AT_PARSER_CHECK for and only for generated parsers' \
$(_sc_search_regexp)
# Indent only with spaces.
# Taken from Coreutils.
sc_prohibit_tab_based_indentation:
@@ -156,11 +144,16 @@ sc_space_before_open_paren:
## syntax-checks exceptions. ##
## -------------------------- ##
# po-check: we use gnulib-po, so we don't need/want them in our POTFILE.
generated_files =
exclude = \
$(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a))))
$(call exclude, \
bindtextdomain=^lib/main.c$$ \
cast_of_argument_to_free=^src/muscle-tab.c$$ \
po_check=^po/POTFILES.in$$ \
preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \
program_name=^lib/main.c$$ \
prohibit_always-defined_macros=^data/skeletons/yacc.c$$ \
@@ -169,8 +162,8 @@ $(call exclude,
prohibit_doubled_word=^tests/named-refs.at$$ \
prohibit_magic_number_exit=^doc/bison.texi$$ \
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \
prohibit_tab_based_indentation=install-icc.sh|\.(am|mk)$$|^\.git|Makefile$$ \
prohibit_strcmp=^doc/bison\.texi|examples|tests/local\.at$$ \
prohibit_tab_based_indentation=install-icc.sh|\.(am|mk)$$|^\.git|tests/input.at|Makefile$$ \
require_config_h=^(lib/yyerror|data/skeletons/(glr|yacc))\.c$$ \
require_config_h_first=^(lib/yyerror|data/skeletons/(glr|yacc))\.c$$ \
space_before_open_paren=^data/skeletons/ \