Commit Graph

37 Commits

Author SHA1 Message Date
Akim Demaille
7c0d37283d gnulib: update 2012-12-19 11:30:22 +01:00
Theophile Ranquet
f3ead217b8 Merge remote-tracking branch 'origin/maint'
* origin/maint:
  misc: pacify the Tiny C Compiler
  cpp: make the check of Flex version portable
  misc: require getline
  c++: support wide strings for file names
  doc: document carets
  tests: enhance existing tests with carets
  errors: show carets
  getargs: add support for --flags/-f

Conflicts:
	doc/bison.texi
	m4/.gitignore
	src/complain.c
	src/flex-scanner.h
	src/getargs.c
	src/getargs.h
	src/gram.c
	src/main.c
	tests/headers.at
2012-12-06 13:38:43 +01:00
Theophile Ranquet
e35cd6def7 misc: require getline
* bootstrap.conf: Here, used by src/location.c.
* src/getargs.c (long_options): Rename --flags to --feature.
2012-12-05 15:39:52 +01:00
Akim Demaille
064e42b0ac Merge remote-tracking branch 'origin/maint'
* origin/maint:
  parser: accept #line NUM
  m4: use a safer pattern to enable/disable output
  tests: beware of gnulib's need for config.h
  gnulib: update
  yacc.c, glr.c: check and fix the display of locations
  formatting changes
  glr.c: remove stray macro

Conflicts:
	data/c.m4
	data/glr.cc
	data/lalr1.cc
	data/lalr1.java
	data/location.cc
	data/stack.hh
	data/yacc.c
	src/scan-gram.l
2012-12-03 16:27:23 +01:00
Akim Demaille
8aef6e0db5 gnulib: update
* lib/yyerror.c: Include config.h since the following stdio.h might be
from gnulib.
2012-11-30 12:37:34 +01:00
Akim Demaille
6c05543cb0 Merge remote-tracking branch 'origin/maint'
* origin/maint:
  regen
  yacc: fix handling of CPP guards when no header is generated
  gnulib: update
2012-09-26 12:19:15 +02:00
Akim Demaille
53425dbfaa gnulib: update 2012-09-25 10:24:36 +02:00
Akim Demaille
cb9ec4fada Merge branch 'maint'
* maint:
  use obstack_printf
  scanner: restore a missing start condition
  gnulib: update
  maint: post-release administrivia
  version 2.6.1
  gnulib: update
  maint: fix some syntax-check issues
  tests: do not depend on __cplusplus to decide for C++ or C output

Conflicts:
	NEWS
	bootstrap.conf
	cfg.mk
	lib/.gitignore
2012-07-31 12:03:55 +02:00
Akim Demaille
aaf63e45b6 use obstack_printf
This is not just nicer, it is also much safer, since we were
using sprintf...

* bootstrap.conf: Require it.
* src/system.h (obstack_fgrow1, obstack_fgrow2, obstack_fgrow3)
(obstack_fgrow4): Remove.
Adjust dependencies.
2012-07-31 10:50:06 +02:00
Akim Demaille
84526bf3d1 maint: don't use mbsr?chr.
Basically, revert ba60c39547a445dee3e07920931b4d7a81843868's move to
mbs* functions, which was prompted by -DGNULIB_POSIXCHECK.  See
<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00052.html>
and following.

* bootstrap.conf: No longer ask for them.
* src/files.c, src/getargs.c, src/location.c,
* src/parse-gram.c, src/parse-gram.y, src/scan-gram.l,
* src/symtab.c: s/mbs(r?chr)/str$1/g.
2012-06-05 17:55:24 +02:00
Akim Demaille
d9a7c07c5a maint: use xconcat-filename.
* bootstrap.conf (gnulib_modules): Request it.
* src/output.h, src/output.c (compute_pkgdatadir): Rename as...
(pkgdatadir): this.
Adjust dependencies.
* src/output.c (output_skeleton): Reduce the scope of "in".
Use xconcatenated_filename to simplify the construction of the
qualified paths to m4sugar.m4, bison.m4, and the selected skeleton.
There are a few minor differences: the new code uses strchr instead of
mbschr (but this was not really justified), and the new code does not
garantee a single slash even if $BISON_PKGDATADIR ends with several
(which was considered more accurate).  See the discussion at
<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00052.html>.
2012-06-05 17:34:57 +02:00
Akim Demaille
b2c4c25d4a maint: update gnulib.
* bootstrap, gnulib: Update.
2012-05-11 09:26:09 +02:00
Akim Demaille
91fd2b60b6 build: config.in.h.
Historically we used config.hin (where everybody else used
config.h.in) to please DOS.  Now that we use gnulib, there are already
tons of files with several dots, especially *.in.h.

* configure.ac: Rename config.hin as config.in.h.
2012-05-09 11:21:34 +02:00
Akim Demaille
e54ec80c0c maint: import the xmemdup0 gnulib module.
* bootstrap.conf: Require this module.
* src/parse-gram.y: Include xmemdup0.h.
2012-05-06 10:20:43 +02:00
Akim Demaille
85557aa1cb maint: remove left-over gnulib modules.
* bootstrap.conf (gnulib_modules): Remove pipe-posix.
* lib/.gitignore, m4/.gitignore: Remove files that we no longer use.
2012-05-06 10:08:18 +02:00
Akim Demaille
a055b2f07d maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC.
* bootstrap.conf (gnulib_modules): Require progname.
	* src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it.
	* cfg.mk (exclude): New.
	Use it.
	Skip lib/main.c for bindtextdomain and set_program_name.
(cherry picked from commit 4d699f44e6)

Conflicts:

	cfg.mk
2012-02-19 18:24:17 +01:00
Akim Demaille
dd5611579b maint: avoid "magic number exit".
* cfg.mk (local-checks-to-skip): No longer skip it.
	* bootstrap.conf (gnulib_modules): Add sysexits.
	* doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y,
	* src/system.h, tests/calc.at, tests/named-refs.at: Use assert
	where appropriate instead of "if (...) exit".
	Use symbolic exit status elsewhere.

Conflicts:

	doc/bison.texinfo
	src/parse-gram.y
2012-02-19 10:21:06 +01:00
Akim Demaille
4c787a31df use a more consistent quoting style.
See <http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.
Use quotearg as often as possible instead of leaving the choice of
the quotes to the translators.  Use shorter messages.  Factor similar
messages to a single format, to make localization easier.

	* src/files.c, src/getargs.c, src/muscle-tab.c, src/reader.c
	* src/scan-code.l, src/scan-gram.l, src/symtab.c:
	Use quote() or quotearg_colon() on printf arguments instead of
	quotes in the format string.
	* data/bison.m4: Keep sync with the changes in muscle-tab.c.

	* tests/skeletons.at, tests/input.at, tests/regression.at: Adjust
	expected messages.
(cherry picked from commit 4a9cd8f24a)

Conflicts:

	src/muscle-tab.c
2012-02-08 11:40:41 +01:00
Jim Meyering
e187b40d31 do not ignore errors like ENOSPC,EIO when writing to stdout
Standard output was never explicitly closed, so we could not
detect failure.  Thus, bison would ignore the errors of writing
to a full file system and getting an I/O error on write, but only
for standard output, e.g., for --print-localedir, --print-datadir,
--help and some verbose output.
Now, "bison --print-datadir > /dev/full" reports the write failure:
bison: write error: No space left on device
Before, it would exit 0 with no diagnostic, implying success.
This is not an issue for "--output=-" or the other FILE-accepting
command-line options, because unlike most other GNU programs,
an output file argument of "-" is treated as the literal "./-",
rather than standard output.
* bootstrap.conf (gnulib_modules): Add closeout.
* src/main.c: Include "closeout.h".
Use atexit to ensure we close stdout.
* .gitignore: Ignore new files pulled in via gnulib-tool.
(cherry picked from commit acb5895680)

Conflicts:

	m4/.gitignore
2012-01-31 09:26:08 +01:00
Jim Meyering
9874f80b2e quote consistently and make tests pass with new quoting from gnulib
Updating to gnulib pulled in new quote and quotarg modules,
by which quoting is now done like 'this' rather than `this'.
That change induces many "make check" test failures.  This change
adapts code and tests so that "make check" passes once again.
* src/scan-code.l: Quote like 'this', not like `this'.
* src/scan-gram.l: Likewise.
* src/symtab.c: Likewise.
* tests/actions.at: Adjust tests to match.
* tests/input.at: Likewise.
* tests/named-refs.at: Likewise.
* tests/output.at: Likewise.
* tests/regression.at: Likewise.
* lib/.gitignore: Regenerate.
* m4/.gitignore: Likewise.
(cherry picked from commit ae93e4e4b8)

Conflicts:

	src/scan-code.l
	src/scan-gram.l
	src/symtab.c
	tests/output.at
2012-01-23 14:07:53 +01:00
Joel E. Denny
d143e9c33f Pacify -DGNULIB_POSIXCHECK.
* bootstrap.conf (gnulib_modules): Add all modules suggested by
-DGNULIB_POSIXCHECK.
* src/files.c (file_name_split)
* src/getargs.c (getargs)
* src/location.c (boundary_set_from_string)
* src/output.c (token_definitions_output, output_skeleton)
* src/parse-gram.y (prologue_declaration)
* src/scan-gram.l (handle_syncline)
* src/symtab.c (symbol_new): Use mbschr and mbsrchr instead of
strchr and strrchr.  In the cases of command-line options, file
names, and thus locations, functionality may be improved.  In the
case of symbol names, there should be no functional difference as
all characters are ASCII, so the intended benefit is just warning
suppression.
2011-05-01 17:35:52 -04:00
Joel E. Denny
a898435b25 gnulib, autoconf: update.
* README-hacking (Updating a submodule): Give advice on how to
determine the versions of gnulib and autoconf to which we should
update.
(Release Procedure): Note that submodules should be updated.
* bootstrap.conf (gnulib_modules): Rename pipe to spawn-pipe as
suggested in updated gnulib NEWS.
* gnulib: Choose a stable snapshot according to advice in Bison's
README-hacking.
* po/POTFILES.in (lib/pipe.c): Rename to...
(lib/spawn-pipe.c): ... this.
* src/output.c: Update to include spawn-pipe.h.
* submodules/autoconf: Update to latest for improvement in m4.m4
that excludes M4 with buggy strstr.  The only other changes to
files that we use are copyright updates.
2011-04-16 14:59:32 -04:00
Joel E. Denny
2f3fd8f986 maint: re-anchor all .gitignore entries.
* bootstrap: Copy from gnulib's latest for the fix to
automatically anchor entries it constructs.
* gnulib: Update to latest just so it has the same bootstrap.
* .gitignore, build-aux/.gitignore, doc/.gitignore:
* lib/.gitignore, m4/.gitignore, po/.gitignore:
* runtime-po/.gitignore: Re-anchor all entries.
(cherry picked from commit e503b9cbbe)

Conflicts:

    build-aux/.gitignore
    doc/.gitignore
    src/.gitignore
2010-10-17 10:23:55 -04:00
Paul Eggert
86996fca10 Adjust to recent changes to gnulib bootstrap.
* .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
* examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
* po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
* tests/.cvsignore: Remove; I don't use CVS to maintain Bison
anymore and don't know of anybody else who does.  If someone needs
these files, they can resurrect them.
* .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
* m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
Omit leading '/', since bootstrap omits it.
Adjust file names to match current contents better.
* bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
installed just for us.
* bootstrap.conf (excluded_files): Don't exclude codeset.m4,
glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
needed somehow.  Don't have time to look into why.
(gnulib_modules): Change malloc to malloc-gnu.  Do we really assume
the GNU malloc behavior, where malloc (0) != NULL unless we're
out of storage?  If not, we can omit malloc-gnu; but for now I left
it in to be safe.
(vc_ignore): Remove.
* README-hacking: Renamed from HACKING, since gnulib bootstrap now
uses that convention.
(cherry picked from commit 95aed8db15)

Conflicts:

	bootstrap
	build-aux/.cvsignore
	build-aux/.gitignore
	doc/.cvsignore
	doc/.gitignore
	etc/.cvsignore
	m4/.cvsignore
	m4/.gitignore
	src/.cvsignore
	src/.gitignore
	tests/.cvsignore
2010-10-16 18:10:48 -04:00
Joel E. Denny
83e34842c1 maint: use announce-gen's new --mail-headers.
* HACKING (Announce): Update instructions.
* cfg.mk (announcement_Cc_): Define.
* configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
required by latest gnulib.
* gnulib: Update to latest.
(cherry picked from commit e565556458)
2010-07-25 19:50:03 -04:00
Joel E. Denny
47fa574761 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.
(cherry picked from commit 22cc8d813e)

Conflicts:

	NEWS
	bootstrap.conf
	lib/.cvsignore
	lib/.gitignore
	m4/.cvsignore
	m4/.gitignore
	src/output.c
2010-02-22 18:32:47 -05:00
Joel E. Denny
f0a43dd1bb * bootstrap: Import improvements from latest gnulib.
(cherry picked from commit 73edad9a25)
2010-01-20 00:41:03 -05:00
Joel E. Denny
8d830047ec gnulib: update to latest. 2010-01-19 14:39:16 -05:00
Joel E. Denny
fb9a3976c2 portability: use -DGNULIB_POSIXCHECK.
Reported by Eric Blake.  See discussions at
<http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
and
<http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
* HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
* bootstrap.conf (gnulib_modules): Add all the printf modules
suggested by -DGNULIB_POSIXCHECK.  Add realloc-posix as
suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
(excluded_files): Remove m4/printf-posix.m4.
* tests/atlocal.in (LIBS): As for LDADD in src/Makefile.am, add
lib/libbison.a so gnulib libraries can be linked.
(cherry picked from commit 5c99151aeb)

Conflicts:

	lib/.cvsignore
	lib/.gitignore
	m4/.cvsignore
	m4/.gitignore
2009-12-15 18:30:34 -05:00
Joel E. Denny
314542f905 maint: fix use of copyright year intervals.
* gnulib: Update.
* bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
as now recommended in gnulib/NEWS.
* build-aux/update-b4-copyright: Fix.
* cfg.mk (update-copyright-env): Configure update-copyright.
(cherry picked from commit 75ac158b82)
2009-08-14 18:48:36 -04:00
Joel E. Denny
dbbb64f091 maint: automate annual package-wide copyright-year update.
* .x-update-copyright: New.
* Makefile.am (EXTRA_DIST): Remove maint.mk.
* bootstrap.conf (gnulib_modules): Add maintainer-makefile and
update-copyright.  Remove gnumakefile, which is implied by
maintainer-makefile.
* cfg.mk (bootstrap-tools): Copy from old maint.mk.
* gnulib: Update.
* maint.mk: Remove, now copied from gnulib.
* examples/extexi: Add missing "(C)" in copyright statement so
update-copyright can recognize it.
* src/LR0.h: Likewise.
* src/print.h: Likewise.
* src/print_graph.h: Likewise.
* src/named-ref.c: Likewise.
* src/named-ref.h: Likewise.
* src/gram.c: Add missing comma in copyright statement.
* src/gram.h: Likewise.
(cherry picked from commit 50bcb22c4c)

Conflicts:

	gnulib
	src/gram.c
2009-08-04 20:03:51 -04:00
Akim Demaille
ed15d907c5 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.
2009-06-10 19:39:46 +02:00
Akim Demaille
5339158d01 Update gnulib. 2009-02-12 09:51:53 +01:00
Joel E. Denny
548e2104e2 Update several administrative files mainly to facilitate releasing.
* HACKING (Administrivia): Make the git-merge-changelog notes more
helpful.
(Test suite): Don't say lalr1.cc is not exercised in the test suite.
(Release Procedure): Update for git and add numerous details that were
previously missing.
* Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
* maint.mk (announcement): Don't list bison as a bootstrap tool so
that announcements don't claim we bootstrapped with whatever bison
happened to be in PATH.  Add flex as a bootstrap tool.
* Makefile.maint: Remove, previously replaced by maint.mk.
* Makefile.cfg: Remove, and migrate settings to...
* cfg.mk: ... here for the sake of `make announcement'.
* bootstrap.conf (gnulib_modules): Add announce-gen.
* README: Say GNU Bison instead of just Bison.  Suggested by Karl
Berry.
2008-10-18 12:18:12 -04:00
Joel E. Denny
9aacab9ae9 Fix some .gitignore and .cvsignore problems.
* bootstrap (insert_sorted_if_absent): Replace all uses with...
(insert_vc_ignore): ... this new function, which prepends `/' to all
.gitignore entries before passing them to insert_sorted_if_absent.
* bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
.cvsignore files are maintained even though Bison developers run
bootstrap while using Git.
* .cvsignore (*.patch *.log log patches applied): Remove, apparently
unneeded by Bison.
(gnulib): Add.
* .gitignore (/*.patch *.log log patches applied): Remove, broken and
unneeded.  Reported by Eric Blake.
* lib/.gitignore (/*~): Add.
* po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
* examples/calc++/.gitignore (/calc++.exe): Add.  Reported by Eric
Blake.
* src/.gitignore (/bison.exe): Add.  Reported by Eric Blake.
2008-07-16 02:05:14 -04:00
Joel E. Denny
a9fc7990fa Improve forward-compatibility with GNU M4.
Reported by Eric Blake at
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
* bootstrap.conf (gnulib_modules): Add unsetenv.
* lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
* m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
(/setenv.m4): Add.
* src/output.c (output_skeleton): For the m4 invocation, pass -dV as
the first argument because it may become position-dependent, and unset
POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
Add comments explaining these issues in more detail.
2008-07-15 21:00:36 -04:00
Joel E. Denny
0f1d6f10d7 Add .gitignore everywhere based on .cvsignore.
* .gitignore: New.
* build-aux/.gitignore: New.
* data/.gitignore: New.
* doc/.gitignore: New.
* etc/.gitignore: New.
* examples/.gitignore: New.
* examples/calc++/.gitignore: New.
* lib/.gitignore: New.
* m4/.gitignore: New.
* po/.gitignore: New.
* runtime-po/.gitignore: New.
* src/.gitignore: New.
* tests/.gitignore: New.
2008-07-14 06:06:26 -04:00