Joel E. Denny [Sat, 10 Apr 2010 21:37:27 +0000 (17:37 -0400)]
tests: fix for newer Sun Studio C++.
Reported by Dagobert Michelsen at
<http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
* THANKS (Dagobert Michelsen): Add.
* configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
Autoconf macro for handling the restrict keyword.
* gnulib: Update to latest, which no longer overrides that macro
from Autoconf.
Joel E. Denny [Sat, 3 Apr 2010 18:58:22 +0000 (14:58 -0400)]
portability: fix pointer arithmetic to conform to C standard.
Reported by Tys Lefering at
<http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
This fix is already implemented in glr.c and does not apply to
lalr1.java.
* data/lalr1.cc (yy::parser::parse): Increase size of
yyerror_range and adjust subscripting so you don't have to
subtract one from the beginning of the array.
* data/yacc.c (b4_declare_parser_state_variables,
yyparse, yypush_parse): Likewise.
Joel E. Denny [Wed, 24 Mar 2010 00:21:59 +0000 (20:21 -0400)]
portability: fix for BSD make.
Reported by Johan van Selst at
<http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
* tests/Makefile.am ($(TESTSUITE)): Qualify package.m4 in
this dependency list as in package.m4's target rule.
Joel E. Denny [Tue, 23 Mar 2010 15:07:46 +0000 (11:07 -0400)]
portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
Reported by Johan van Selst at
<http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
* NEWS (2.4.3): New.
* THANKS (Johan van Selst): Add.
* gnulib: Update to latest.
Joel E. Denny [Sat, 20 Mar 2010 17:10:09 +0000 (13:10 -0400)]
Version 2.4.2.
* NEWS (2.4.2): Set version and date. For the recent test suite
portability fixes, don't be so optimistic about their success
given the lack of feedback on the affected platforms.
Joel E. Denny [Tue, 23 Feb 2010 02:59:18 +0000 (21:59 -0500)]
Version 2.4.1b.
* NEWS (2.4.2): Rename to...
(2.4.1b): ... this for now. Set date.
* configure.ac (AM_INIT_AUTOMAKE): Disable gnits for now because
it does not like this version name.
Joel E. Denny [Tue, 23 Feb 2010 02:52:39 +0000 (21:52 -0500)]
tests: fix maintainer-xml-check for recent changes.
* tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
output file whose name conflicts with a previous output file
is now never generated.
Joel E. Denny [Mon, 22 Feb 2010 23:09:19 +0000 (18:09 -0500)]
portability: fix several issues with M4 subprocess.
M4's output pipe was not being drained upon fatal errors during
scan_skel. As a result, broken-pipe messages from M4 were seen
on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
failure in the test suite. The problem was that, on platforms
where the default disposition for SIGPIPE is ignore instead of
terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
then reported it. However, there's some sort of race condition,
because the new test group occasionally succeeded.
Reported by Albert Chin at
<http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
There were also problems with the test suite livelocking on
Tru64 5.1b. Reported by Didier Godefroy at
<http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
Switching to create_pipe_bidi suggested by Akim Demaille.
To attempt to solve both of these problems, switch to gnulib's
create_pipe_bidi and register M4 process as a slave. Along the
way, clean up file name conflict handling, which was affected by
the broken-pipe problem before the switch.
* NEWS (2.4.2): Document.
* THANKS (Didier Godefroy): Add.
* bootstrap.conf (gnulib_modules): Add pipe.
* gnulib: Update to latest to make sure we have all the latest
fixes.
* lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and
subpipe.c.
* po/POTFILES.in (lib/subpipe.c): Remove.
* src/files.c (compute_output_file_names): Update invocations
of output_file_name_check.
(output_file_name_check): In the case that the grammar file
would be overwritten, use complain instead of fatal, but replace
the output file name with /dev/null. Use the /dev/null solution
for the case of two conflicting output files as well because it
seems safer in case Bison one day tries to open both files at
the same time.
* src/files.h (output_file_name_check): Update prototype.
* src/output.c (output_skeleton): Use create_pipe_bidi and
wait_subprocess. Assert that scan_skel completely drains the
pipe.
* src/scan-skel.l (at_directive_perform): Update
output_file_name_check invocation.
* tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
grammar file actually isn't overwritten.
(Conflicting output files: -o foo.y): Update expected output.
* tests/skeletons.at (Fatal errors but M4 continues producing
output): New test group.
Joel E. Denny [Mon, 1 Feb 2010 20:54:41 +0000 (15:54 -0500)]
tests: link lib/libbison.a for gnulib.
This solves a problem on Solaris 2.7 where the testsuite needs
at least gnulib's rpl_fopen. Reported by Albert Chin at
<http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00001.html>.
* NEWS (2.4.2): Document.
* tests/atlocal.in (LIBS): As for LDADD in src/Makefile.am, add
lib/libbison.a.
Joel E. Denny [Thu, 21 Jan 2010 23:17:55 +0000 (18:17 -0500)]
Version 2.4.1a.
* NEWS (2.4.2): Rename to...
(2.4.1a): ... this for now. Set date.
* configure.ac (AM_INIT_AUTOMAKE): Disable gnits for now because
it does not like this version name.
Joel E. Denny [Thu, 21 Jan 2010 17:18:45 +0000 (12:18 -0500)]
maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
* HACKING (Release Procedure): Update notes on copyright years.
* Makefile.am (update-package-copyright-year): New target rule.
* build-aux/update-package-copyright-year: New file.
* cfg.mk (update-copyright): Add update-package-copyright-year
as a dependency.
Joel E. Denny [Wed, 30 Dec 2009 08:20:11 +0000 (03:20 -0500)]
POSIX: warn if %prec's token was not defined.
Reported by Florian Krohm at
<http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
* NEWS (2.4.2): Document.
* src/reader.c (grammar_rule_check): Implement.
(grammar_current_rule_prec_set): Add comments explaining that we
here assume a %prec identifier is a token, but we still manage
to support POSIX.
* tests/input.at (%prec's token must be defined): New test
group.
Joel E. Denny [Wed, 16 Dec 2009 18:19:19 +0000 (13:19 -0500)]
Add gcc's -Wundef to test suite and fix another warning from it.
* NEWS (2.4.2): Update description of -Wundef fix.
* configure.ac (WARN_CXXFLAGS_TEST): New substitution.
(WARN_CFLAGS_TEST): New substitution.
* data/glr.c: Avoid warning about __STRICT_ANSI__.
* tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
WARN_CFLAGS.
(CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
(cherry picked from commit a603c6e0bb8b9e79d4136ee0fd0d1bf6a7d010ef)
Jonathan Nieder [Wed, 16 Dec 2009 04:03:18 +0000 (22:03 -0600)]
Avoid warnings from gcc -Wundef y.tab.c.
* data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
defined before using them.
* data/lalr1.cc: Likewise.
* data/yacc.c: Likewise.
(cherry picked from commit ae93128c9671b58bdc2b557c382ecd84e659ab52)
Joel E. Denny [Mon, 14 Dec 2009 23:04:57 +0000 (18:04 -0500)]
Enable assertion output and --disable-assert for configure.
* bootstrap.conf (gnulib_modules): Add assert module.
* src/system.h (aver): Define as assert, and summarize the
discussion on this issue.
(cherry picked from commit ca01f454f01645533622a59ef0df335ee07679e5)
Joel E. Denny [Mon, 5 Oct 2009 02:59:18 +0000 (22:59 -0400)]
tests: skip tests of file names that platform does not support.
Reported by Michael Raskin at
<http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
* THANKS (Michael Raskin): Add.
* tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
to fail at least for file names containing ":" or "\".
Joel E. Denny [Sun, 13 Sep 2009 17:45:05 +0000 (13:45 -0400)]
tests: clean up push.at test group titles.
* tests/push.at: Remove "Push Parsing: " from test group titles
because these are already under the banner "Push Parsing Tests".
(cherry picked from commit 00d80a9cedbffda49212c0cdb90e90c27a561bb2)
Joel E. Denny [Thu, 27 Aug 2009 07:52:53 +0000 (03:52 -0400)]
tests: use perl for printing special sequences to files.
And skip tests if perl is not available. This is better than
playing tricks with shell portability. Suggested by Akim
Demaille.
* tests/input.at (Bad escapes in literals): Use it here for special
characters.
(cherry picked from commit b70c7fb4e1db54e78d4f3d4a0f110a81118ffc60)
Joel E. Denny [Sat, 22 Aug 2009 00:09:54 +0000 (20:09 -0400)]
Use locale when quoting.
* src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
quote rather than implementing quoting here.
(cherry picked from commit e6c849d82a95be8a595c254cc3046cfae725f064)
Eric Blake [Thu, 20 Aug 2009 14:24:46 +0000 (08:24 -0600)]
Import latest m4/m4.m4.
* m4/m4.m4: Copy from autoconf 2.64.
* configure.ac (M4_GNU_OPTION): New define.
* src/output.c (output_skeleton): Use it to resolve FIXME.
* NEWS: Mention this.
Joel E. Denny [Thu, 20 Aug 2009 00:37:28 +0000 (20:37 -0400)]
Fix complaints about escape sequences.
Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
* src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
For a \0 and similar escape sequences meaning the null
character, report an invalid escape sequence instead of an
invalid null character because the latter does not actually
appear in the user's input.
In all escape sequence complaints, don't escape the initial
backslash, and don't quote when the sequence appears at the end
of the complaint line unless there's whitespace that quotearg
won't escape.
Consistently say "invalid" not "unrecognized".
* tests/input.at (Bad escapes in literals): New.
(cherry picked from commit c2724603c9d87e816dbdf1a9bfd7d70ffc1bd137)
Joel E. Denny [Tue, 18 Aug 2009 22:29:54 +0000 (18:29 -0400)]
maint: update for gnulib's recent update-copyright changes
* gnulib: Update.
* .x-update-copyright (COPYING): Add as it's no longer implied
when .x-update-copyright is present.
* cfg.mk (update-copyright-local): Remove, now ignored.
(update-copyright): Declare update-b4-copyright as a dependency.
(cherry picked from commit c67e466f9d4f63d360d82dc23b9bfffb4d846209)
Akim Demaille [Mon, 17 Aug 2009 07:22:41 +0000 (09:22 +0200)]
build: lower gettext requirements.
Bison was uselessly requiring the formatstring macros from
gettext, which resulted in mo files not being installed on systems
that perfectly supported Bison mo files. Lower the requirement.
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
* configure.ac: Require need-ngettext instead of
need-formatstring-macros.
Reported by Martin Jabocs.
Suggested by Bruno Haible.
* INSTALL: Restructure.
(Internationalization): New.
Joel E. Denny [Thu, 6 Aug 2009 15:34:09 +0000 (11:34 -0400)]
maint: make update-b4-copyright easier to use
* build-aux/update-b4-copyright: In warnings, report line
numbers rather than character positions.
* cfg.mk (update-copyright-local): Set to update-b4-copyright so
that update-copyright runs it.
* gnulib: Update.
(cherry picked from commit a1a9422d4a2f70ff89e06318ba154851c3700f60)
Joel E. Denny [Wed, 5 Aug 2009 23:52:41 +0000 (19:52 -0400)]
maint: clean up update-b4-copyright code
* build-aux/update-b4-copyright: Do not accept 2-digit
UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
Don't accept a `[' in a b4_copyright argument.
Format code more consistently.
Don't assume b4*copyright never occurs.
(cherry picked from commit 0b61a8ec1842bfbd6130714d06b758165b32ead4)
Joel E. Denny [Sat, 1 Aug 2009 21:51:34 +0000 (17:51 -0400)]
Pacify "gcc -Wunused" for the input function from Flex.
Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
and later.
* src/scan-code.l: Add "%option noinput", which I cannot find in
the Flex manual, but which Flex has supported since at least as
far back as 2.5.4. However, if any of our developers still use
Flex 2.5.4, they'll need to stop configuring with
--enable-gcc-warnings because "%option noinput" didn't work
correctly until Flex 2.5.6.
* src/scan-gram.l: Likewise.
* src/scan-skel.l: Likewise.
Akim Demaille [Mon, 29 Jun 2009 13:02:48 +0000 (15:02 +0200)]
build: avoid concurrent extraction of calc++.
* examples/calc++/Makefile.am (calc.stamp): New.
Depend on it to create the sources of calc++ so that concurrent
builds don't launch several "extexi" in parallel.
Not only this is inefficient, this also builds incorrect sources
with several extractions mixed together.
Akim Demaille [Wed, 10 Jun 2009 08:40:55 +0000 (10:40 +0200)]
gnulib: update.
* gnulib: Update to latest.
* lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
* m4/.gitignore: Regen.
* src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
Call xalloc_die on hash_insert failures.
Requested by the new __warn_unused_result__ attribute of
hash_insert.
Joel E. Denny [Tue, 19 May 2009 21:51:05 +0000 (17:51 -0400)]
Handle a trailing `:' in a user-supplied C++ namespace better.
* data/c++.m4 (b4_namespace_close): Don't let it be printed
among the closing braces here. This fix might make the
generated code easier to debug, but otherwise it should be
insignificant because a trailing `:' is a C++ error already.
(cherry picked from commit 8c221795affd367ac106161610d42fc94633e3fd)
Joel E. Denny [Mon, 6 Apr 2009 06:16:39 +0000 (02:16 -0400)]
Fix options documentation.
* build-aux/cross-options.pl: As in --help output, write optional
arguments as [=ARG] not =[ARG].
* doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
* build-aux/cross-options.pl: The argument ends at the first
space, not the first non-symbol character.
Use @var for each word appearing the argument description.
(cherry picked from commit 74eae918c3bf3772d260cb25777d9a998172a401)
Joel E. Denny [Sun, 5 Apr 2009 01:12:23 +0000 (21:12 -0400)]
Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
requirements for a correct m4 are stricter.
* m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
* configure.ac: Update to use AC_PROG_GNU_M4.
Reported by Eric Blake.
Joel E. Denny [Fri, 3 Apr 2009 07:13:36 +0000 (03:13 -0400)]
Fix strange %define locations for default values.
Reported by Akim Demaille at
<http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
and discussed again starting at
<http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
* data/bison.m4 (b4_percent_define_default): Leave syncline blank
because location information is bogus.
Use angle brackets to delimit fake file name because square brackets
look like over-quoted m4. Choose a better fake file name.
Use negative line numbers.
* src/muscle_tab.c (muscle_percent_define_default): Likewise.
* src/location.c (location_print): If line for a boundary is negative,
only print that boundary's file name.
* src/location.h: Document that.
* tests/skeletons.at (%define Boolean variables: invalid skeleton
defaults): Update output.
Akim Demaille [Thu, 26 Mar 2009 22:02:18 +0000 (23:02 +0100)]
lalr1.cc: avoid GCC 4.3 warnings.
GCC 4.3 now warns about "a || b && c" and asks for explicit
parentheses.
Reported by Alexandre Duret-Lutz.
* data/location.cc: Update copyright years.
(Position::operator==): Use parens to make precedence explicit.
Compare lines and columns first, as they are more likely to be
different, and they are faster to compare.
Akim Demaille [Thu, 8 Jan 2009 08:41:21 +0000 (09:41 +0100)]
Fix grep portability issues.
Grep on Solaris does not support -q.
Reported by Summum Bonum.
* NEWS: Add a stub for 2.4.2.
* THANKS: Add Summum Bonum.
* tests/atlocal.in (EGREP): New.
(CC, CXX, XSLTPROC): Make it possible to override them via
envvars.
* tests/java.at: Use $EGREP instead of egrep.
Use AT_CHECK's ignore instead of grep's -q.
Eric Blake [Fri, 5 Dec 2008 16:26:38 +0000 (09:26 -0700)]
Build testsuite with newer autoconf.
* tests/output.at (m4_expand): Don't override in newer autoconf,
where the underlying implementation changed.
* tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
(_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
(_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
(_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
since some of them contain unbalanced ')'.
Joel E. Denny [Wed, 19 Nov 2008 03:34:26 +0000 (22:34 -0500)]
Fix unexpanded macros in GLR defines file.
Reported by Csaba Raduly at
<http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
* THANKS (Csaba Raduly): Add.
* data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
* tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
lexer in a separate module that includes the defines file.
(AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
source.
* tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
(AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
(AT_DATA_SOURCE_PROLOGUE): New.
(AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
(AT_DATA_SOURCE): New.
(AT_FULL_COMPILE): New, copied from master branch and extended to
support an additional output file.
Di-an Jan [Mon, 17 Nov 2008 10:07:29 +0000 (11:07 +0100)]
Fix formatting and content of bison.texinfo menus
* doc/bison.texinfo: Synchronize ``Detail Node Listing''.
Align menus. Adjust word wrapping. Use node names for menu names.
(Examples): Don't abbreviate node names.
(LocalWords): Remove abbreviations.
(Copying): Make description a sentence.
(Java Action Features): Remove period to match the rest of menu.
Joel E. Denny [Fri, 7 Nov 2008 21:48:31 +0000 (16:48 -0500)]
Clean up %skeleton and %language priority implementation.
* src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
remove static qualifier because others will soon need to see it.
(language_prio): Likewise.
(getargs): Use command_line_prio rather than 0.
* src/getargs.h (command_line_prio, grammar_prio, default_prio): New
enum fields.
(skeleton_prio): Extern it.
(language_prio): Extern it.
* src/parse-gram.y: Use grammar_prio rather than 1.