Commit Graph

280 Commits

Author SHA1 Message Date
Paul Eggert
dcf16ff191 maint: make update-copyright 2026-01-18 09:45:29 -08:00
Paul Eggert
4ff0741f58 maint: make update-copyright 2025-03-17 17:48:06 -07:00
Akim Demaille
ec9c5556d9 tests: ignore messages from the JVM
Reported by Giorgos Pap.
<https://lists.gnu.org/r/bug-bison/2022-08/msg00002.html>

* examples/test: Discard "Picked up _JAVA_OPTIONS:" messages.
2022-09-03 09:13:48 +02:00
Akim Demaille
cfef21f5b0 diagnostics: Windows compatibility issues
Suggested by Bruno Haible
<https://lists.gnu.org/r/bug-bison/2022-08/msg00006.html>
following a report from Andrei Malashkin
<https://lists.gnu.org/r/bug-bison/2022-08/msg00003.html>

* src/location.c (caret_set_file): Read the file in binary.
We already deal with CRLF in caret_getc_internal.
2022-09-03 08:58:49 +02:00
Akim Demaille
a166d5450e yacc.c, lalr1.cc: fix warnings about yynerrs
Most often yynerrs is not used.  Clang 15 now complains about such
variables.  Bison itself does not compile:

```
src/parse-gram.c:1797:9: error: variable 'gram_nerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^
src/parse-gram.c:79:25: note: expanded from macro 'yynerrs'
                        ^
1 error generated.
```

Reported by Nikita Popov.
Fixes https://github.com/akimd/bison/issues/89.

* data/skeletons/yacc.c (yynerrs): Flag with YY_ATTRIBUTE_UNUSED.
* data/skeletons/lalr1.cc (yynerrs_): Likewise.
2022-08-02 09:07:31 +02:00
Paul Eggert
07e18e7fb4 package: bump copyrights to 2022
Run "make update-copyright".
2022-01-15 11:16:30 -08:00
Akim Demaille
c95d0dd5f5 warnings: be less picky about occurrences of m4_/b4_ in the output
Reported by Marko Mäkelä.
<https://lists.gnu.org/r/bug-bison/2021-10/msg00026.html>

* src/scan-skel.l: It is ok to have foob4_ or foom4_.
* tests/skeletons.at (Suspicious sequences): New.
2021-11-06 19:30:06 +01:00
Paul Eggert
b4582f1918 Update URLs to prefer https: to http:
Also, fix a few http: URLs that were no longer working.
2021-01-29 13:48:43 -08:00
Akim Demaille
d7e8aaa271 package: bump copyrights to 2021
Run 'make update-copyright'.
2021-01-16 16:11:17 +01:00
Akim Demaille
0a82316e54 glr2.cc: example: use objects (not pointers) to represent the AST
Currently we are using pointers.  The whole point of
glr2.cc (vs. glr.cc) is precisely to allow genuine C++ objects to be
semantic values.  Let's make that work.

* data/skeletons/glr2.cc (glr_state::glr_state): Be sure to initialize
yysval.
(glr_state): Add copy-ctor, assignment and dtor.
(glr_state::copyFrom): Be sure to initialize the destination if it was
not.
(glr_state::~glr_state): Destroy the semantic value.
* examples/c++/glr/ast.hh: Rewrite so that we use genuine objects,
rather than a traditional OOP hierarchy that requires to deal with
pointers.
With help from Bruno Belanyi <bruno.belanyi@epita.fr>.
* examples/c++/glr/c++-types.yy: Remove memory management.
Use true objects.
(main): Don't reach yydebug directly.

* examples/c++/glr/local.mk: We need C++11.
2020-12-20 18:41:42 +01:00
Maarten De Braekeleer
8cf098415e portability: use INT_LITERAL instead of INT because MSVC defines INT
It is defined as a typedef, not a macro.
https://lists.gnu.org/r/bison-patches/2020-08/msg00001.html

* src/parse-gram.y, src/scan-gram.l: here.
2020-08-02 08:32:30 +02:00
Akim Demaille
d975c2f76e libtextstyle: be sure to have ostream_printf and hyperlink support
Older versions of libtextstyle do not support them, rule them out.

Reported by Lars Wendler
https://lists.gnu.org/r/bug-bison/2020-07/msg00030.html

and by Arnold Robbins
https://lists.gnu.org/r/bug-bison/2020-07/msg00041.html and
https://lists.gnu.org/mailman/private/gawk-devel/2020-July/003988.html

and by Nelson H. F. Beebe
https://lists.gnu.org/mailman/private/gawk-devel/2020-July/003993.html

With support from Bruno Haible in gnulib
https://lists.gnu.org/r/bug-gnulib/2020-08/msg00000.html
thread starting at
https://lists.gnu.org/r/bug-gnulib/2020-07/msg00148.html

* configure.ac: Require libtextstyle 0.20.5.
* gnulib: Update.
2020-08-02 08:19:35 +02:00
Akim Demaille
be95a4fe29 scanner: don't crash on strings containing a NUL byte
We crash if the input contains a string containing a NUL byte.
Reported by Suhwan Song.
https://lists.gnu.org/r/bug-bison/2020-07/msg00051.html

* src/flex-scanner.h (STRING_FREE): Avoid accidental use of
last_string.
* src/scan-gram.l: Don't call STRING_FREE without calling
STRING_FINISH first.
* tests/input.at (Invalid inputs): Check that case.
2020-07-28 19:01:48 +02:00
Akim Demaille
64a3b6546a cex: more colors
Provided by Daniela Becker.

* data/bison-default.css: More colors.
2020-07-15 06:38:36 +02:00
Akim Demaille
d796e11f8f news: fixes
Reported by Jacob L. Mandelson.

* NEWS: here.
2020-06-27 17:04:50 +02:00
Akim Demaille
eeafc706e8 c++: by default, use const std::string for file names
Reported by Martin Blais and Yuriy Solodkyy.
https://lists.gnu.org/r/help-bison/2020-05/msg00011.html
https://lists.gnu.org/r/bug-bison/2020-06/msg00038.html

While at it, modernize filename_type as api.filename.type and document
it properly.

* data/skeletons/c++.m4 (filename_type): Rename as...
(api.filename.type): this.
Default to const std::string.
* data/skeletons/location.cc (position, location): Expose the
filename_type type.
Use api.filename.type.
* doc/bison.texi (%define Summary): Document api.filename.type.
(C++ Location Values): Document position::filename_type.
* src/muscle-tab.c (muscle_percent_variable_update): Ensure backward
compatibility.
* tests/c++.at: Check that using const file names is ok.
tests/input.at: Check backward compat.
2020-06-27 10:06:00 +02:00
Akim Demaille
cf6d8d0631 ielr: fix crash on memory management
Reported by Dwight Guth.
https://lists.gnu.org/r/bug-bison/2020-06/msg00037.html

* src/AnnotationList.c (AnnotationList__computePredecessorAnnotations):
Beware that SBITSET__FOR_EACH nests _two_ for-loops, so "break" does
not actually break out of it.
That was the only occurrence in the code.
* src/Sbitset.h (SBITSET__FOR_EACH): Warn passersby.
2020-06-27 08:16:07 +02:00
Akim Demaille
52ce2a008b build: check -Wmissing-prototypes
pstate_clear is lacking a prototype.
Reported by Ryan
https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html

Besides, none of the C examples were compiled with the warning flags.

* configure.ac (warn_c): Add -Wmissing-prototypes.
* data/skeletons/yacc.c (pstate_clear): Make it static.
* examples/local.mk (TEST_CFLAGS): New.
* examples/c/bistromathic/local.mk, examples/c/calc/local.mk,
* examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk,
* examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk,
* examples/c/rpcalc/local.mk:
Use it.

GCC's warn_unused_result is not silenced by a cast to void, so we have
to "use" scanf's result.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

Flex generated code produces too many warnings, including things such
as, with ICC:

    examples/c/lexcalc/scan.c(1088): error #1682: implicit conversion
              of a 64-bit integral type to a smaller integral type (potential portability problem)
    2259                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
    2260                ^
    2261
    2262

I am tired of trying to fix Flex's output.  The project does not seem
maintained.  We ought to avoid it.  So, for the time being, don't try
to enable warnings with Flex.

* examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix
warnings.
* doc/bison.texi: Discard scanf's return value to defeat
-Werror=unused-result.
2020-06-01 08:29:53 +02:00
Akim Demaille
ac2ba46053 doc: clarify what a location is
Reported by Arthur Schwarz <aschwarz1309@att.net>
https://lists.gnu.org/r/help-bison/2013-12/msg00009.html

* doc/bison.texi (Location Type): here.
2020-05-03 11:28:36 +02:00
Akim Demaille
ccaa8e29f9 c++: provide backward compatibility on by_type
To write unit tests for their scanners, some users depended on
symbol_type::token():

    Lexer lex("12345");
    symbol_type t = lex.nextToken();
    assert(t.token() == token::INTLIT);
    assert(t.value.as<int>() == 12345);

But symbol_type::token() was removed in Bison 3.5 because it relied on
a conversion table.  So users had to find other patterns, such as

    assert(t.type_get() == by_type(token::INTLIT).type_get());

which relies on several private implementation details.

As part of transitioning from "token type" to "token kind", and making
this a public and documented interface, "by_type" was renamed
"by_kind" and "type_get()" was renamed as "kind()".  The latter had
backward compatibility mechanisms, not the former.

In Bison 3.6 none of this should be used, but rather

    assert(t.kind() == symbol_kind::S_INTLIT);

Reported by Pramod Kumbhar.
https://lists.gnu.org/r/bug-bison/2020-05/msg00012.html

* data/skeletons/c++.m4 (by_type): Make it an alias to by_kind.
2020-05-03 09:20:08 +02:00
Akim Demaille
30357ae942 c++: use modern idioms to make classes non-copyable
Reported by Don Macpherson.
https://lists.gnu.org/r/bug-bison/2019-05/msg00015.html
https://github.com/akimd/bison/issues/36

* data/skeletons/lalr1.cc, data/skeletons/stack.hh,
* data/skeletons/variant.hh: Delete the copy-ctor and the copy operator.
2020-05-01 06:52:04 +02:00
Akim Demaille
7aee4586ca Merge branch 'maint'
* maint:
  maint: post-release administrivia
  version 3.5.4
  examples: reccalc: really compile cleanly in C99
  news: announce that Bison 3.6 drops YYERROR_VERBOSE
  news: update for 3.5.4
  style: fix spellos
  typo: succesful -> successful
  package: improve the readme
  java: check and fix support for api.token.raw
  java: style: prefer 'int[] foo' to 'int foo[]'
  build: fix syntax-check issues
  tests: recheck: work properly when the test suite was interrupted
  doc: c++: promote api.token.raw
  build: fix compatibility with old compilers
  examples: reccalc: compile cleanly in C99
2020-04-05 09:38:15 +02:00
Akim Demaille
6e89bc0fd2 build: fix compatibility with old compilers
GCC 4.2 dies with

    src/InadequacyList.c: In function 'InadequacyList__new_conflict':
    src/InadequacyList.c:37: error: #pragma GCC diagnostic not allowed inside functions
    src/InadequacyList.c:37: error: #pragma GCC diagnostic not allowed inside functions
    src/InadequacyList.c:40: error: #pragma GCC diagnostic not allowed inside functions

Reported by Evan Lavelle.
See https://lists.gnu.org/r/bug-bison/2020-03/msg00021.html
and https://trac.macports.org/ticket/59927.

* src/system.h (GCC_VERSION): New.
Use it to control IGNORE_TYPE_LIMITS_BEGIN and
IGNORE_TYPE_LIMITS_END.
2020-04-02 07:16:44 +02:00
Akim Demaille
1045c8d0ef examples: don't use yysyntax_error_arguments
Suggested by Adrian Vogelsgesang.
https://lists.gnu.org/archive/html/bison-patches/2020-02/msg00069.html

* data/skeletons/lalr1.java (Context.EMPTY, Context.getToken): New.
(Context.yyntokens): Rename as...
(Context.NTOKENS): this.
Because (i) all the Java coding styles recommend upper case for
constants, and (ii) the Java Skeleton exposes Lexer.EOF, not
Lexer.YYEOF.
* data/skeletons/yacc.c (yyparse_context_token): New.
* examples/c/bistromathic/parse.y (yyreport_syntax_error): Don't use
yysyntax_error_arguments.
* examples/java/calc/Calc.y (yyreportSyntaxError): Likewise.
2020-03-28 15:13:27 +01:00
Akim Demaille
641e326303 code: be robust to reference with invalid tags
Because we want to support $<a->b>$, we must accept -> in type tags,
and reject $<->$, as it is unfinished.
Reported by Ahcheong Lee.

* src/scan-code.l (yylex): Make sure "tag" does not end with -, since
-> does not close the tag.
* tests/input.at (Stray $ or @): Check this.
2020-03-06 17:29:26 +01:00
Akim Demaille
1587a5ea9b examples: be more robust to spaces in paths
Reported by Nikki Valen.
https://lists.gnu.org/r/bug-bison/2020-01/msg00032.html

* examples/test ($prog): Remove, replaced by...
(prog): This new function, which pays attention to quoting shell
variables.
2020-01-21 07:01:34 +01:00
Akim Demaille
61b8a8def5 CI: use ICC again
See https://github.com/nemequ/icc-travis/issues/15.
Thanks to Jeff Hammond and Evan Nemerson for their help.

* configure.ac (warn_common): Disable dubious warnings.
* .travis.yml: Use ICC again.
2020-01-19 11:36:47 +01:00
Akim Demaille
c67daa9a97 package: bump copyrights to 2020
Run 'make update-copyright'.
2020-01-10 19:16:23 +01:00
Akim Demaille
28369ecb5d tests: avoid creating files whose name collide with standard headers
Having a file named "exception" is risky: the compiler might use that
file in #include.
Reported by 马俊 <majun123@whu.edu.cn>.

* tests/local.at (AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR): Generate
'exceptions', not 'exception'.
2019-11-26 08:05:32 +01:00
Akim Demaille
719395c9cd examples: fix missing dependencies
Reported by Thomas Petazzoni.
https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00000.html

* examples/c/reccalc/local.mk: Complete dependencies, including for
earlier versions of Automake (for sake of our CI, on top of Ubuntu
Xenial/Bionic, which feature only Automake 1.15).
(%D%/scan.c %D%/scan.h): Upgrade to the full version provided in
Automake's documentation.
2019-10-24 18:01:53 +02:00
Yuichiro Kaneko
3945beb1d2 style: update comment in reader.c
rrhs and rlhs were removed by b2ed6e5826.

* src/reader.c (packgram): Update comment.
2019-10-23 08:32:06 +02:00
Akim Demaille
2c20ae9b41 glr: display line numbers in traces
Suggested by Lars Maier.

* data/skeletons/glr.c: Also display rule locations when rules are
deferred, and rejected.
2019-10-11 08:38:24 +02:00
Akim Demaille
2ca6b71967 yacc: use the most appropriate integral type for state numbers
Currently we properly use the "best" integral type for tables,
including those storing state numbers.  However the variables for
state numbers used in yyparse (and its dependencies such as
yy_stack_print) still use int16_t invariably.  As a consequence, very
large models overflow these variables.

Let's use the "best" type for these variables too.  It turns out that
we can still use 16 bits for twice larger automata: stick to unsigned
types.

However using 'unsigned' when 16 bits are not enough is troublesome
and generates tons of warnings about signedness issues.  Instead,
let's use 'int'.

Reported by Tom Kramer.
https://lists.gnu.org/archive/html/bug-bison/2019-09/msg00018.html

* data/skeletons/yacc.c (b4_state_num_type): New.
(yy_state_num): Be computed from YYNSTATES.
* tests/linear: New.
* tests/torture.at (State number type): New.
Use it.
2019-09-30 18:31:55 +02:00
Akim Demaille
406e8c7c02 c++: add copy ctors for compatibility with the IAR compiler
Reported by Andreas Damm.
https://savannah.gnu.org/support/?110032

* data/skeletons/lalr1.cc (stack_symbol_type::operator=): New
overload, const, to please the IAR C++ compiler (version ca 2013).
2019-09-27 08:40:52 +02:00
Akim Demaille
b2c381cd25 quotearg: avoid leaks
Reported by Tomasz Kłoczko.
https://lists.gnu.org/archive/html/bug-bison/2019-09/msg00008.html

* src/main.c (main): Free quotearg's memory later.
2019-09-22 18:15:36 +02:00
Akim Demaille
f8db8fe4d7 fix: don't die when EOF token is defined twice
With

    %token EOF 0 EOF 0

we get

    input.y:3.14-16: warning: symbol EOF redeclared [-Wother]
        3 | %token EOF 0 EOF 0
          |              ^~~
    input.y:3.8-10: previous declaration
        3 | %token EOF 0 EOF 0
          |        ^~~
    Assertion failed: (nsyms == ntokens + nvars), function check_and_convert_grammar,
        file /Users/akim/src/gnu/bison/src/reader.c, line 839.

Reported by Marc Schönefeld.

* src/symtab.c (symbol_user_token_number_set): Register only the
first definition of the end of input token.
* tests/input.at (Symbol redeclared): Check that case.
2019-09-08 11:38:29 +02:00
Akim Demaille
f788ba2ab6 check for memory exhaustion
hash_initialize returns NULL when out of memory.  Check for it, and
die cleanly instead of crashing.

Reported by 江 祖铭 (Zu-Ming Jiang).
https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00015.html

* src/muscle-tab.c, src/state.c, src/symtab.c, src/uniqstr.c:
Check the value returned by hash_initialize.
2019-09-08 11:38:29 +02:00
László Várady
e63811dd86 diagnostics: fix invalid error message indentation
https://lists.gnu.org/archive/html/bison-patches/2019-08/msg00007.html

When Bison is started with a flag that suppresses warning messages, the
error_message() function can produce a few gigabytes of indentation
because of a dangling pointer.

* src/complain.c (error_message): Don't reset indent_ptr here, but...
(complain_indent): here.
* tests/diagnostics.at (Indentation with message suppression): Check
this case.
2019-09-08 11:38:29 +02:00
Akim Demaille
9f26e6d6b3 thanks: fix an address 2019-05-22 18:09:04 +02:00
Akim Demaille
70c3f3ade5 doc: avoid Texinfo portability issues
Reported by Bruno Haible.
http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00024.html
Fixed by Karl Berry.
http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00034.html

* doc/bison.texi: Don't specify the langage, rely on the default.
Avoid blank pages.
2019-05-20 06:12:47 +02:00
Akim Demaille
c8e57e8159 diagnostics: don't crash when libtextstyle is installed
Reported by neok m4700.
https://lists.gnu.org/archive/html/bison-patches/2019-05/msg00025.html
https://github.com/akimd/bison/pull/11

* src/complain.c (complain_init_color): style_file_prepare _needs_ a
string as second argument.
2019-05-19 18:16:47 +02:00
Akim Demaille
de5207244b diagnostics: %pure-parser is obsolete
Reported by Uxio Prego.
http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00029.html

* src/scan-gram.l, src/parse-gram.y (PERCENT_PURE_PARSER)
(handle_pure_parser): New.
Issue a deprecation/update notice for %pure-parser.
* doc/bison.texi (Java Bison Interface): Don't mention %pure-parser.
* tests/actions.at, tests/input.at: Adjust.
2019-05-19 10:05:18 +02:00
Akim Demaille
a1a847bfb5 CI: use a pipeline: first build the tarball, then check it
Build the tarball in one job, check it in many.
Unfortunately no real gain in overall duration.
With help from Clément Démoulins.

* .travis.yml: here.
Remove all the tricks that were used to be able to boostrap on old
distros.
(before_install): Merge into 'script', because before_install applies
to all the jobs, and we don't want to run it for the 'compile' job.
2019-05-19 09:45:27 +02:00
Akim Demaille
ab3eaff7c4 doc: use colors for diagnostics in TeX too
Thanks to Gavin Smith and Patrice Dumas.
http://lists.gnu.org/archive/html/help-texinfo/2019-04/msg00015.html

* doc/bison.texi (@colorWarning, @colorError, @colorNotice)
(@colorOff): Define for TeX and HTML.
(@dwarning, @derror, @dnotice): Use them.
2019-05-09 19:21:02 +02:00
Akim Demaille
a992a3cb9e diagnostics: don't try to quote special files
Based on a report by Todd Freed.
http://lists.gnu.org/archive/html/bug-bison/2019-04/msg00000.html
See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90034

* src/location.c (caret_info): Also track the file name.
(location_caret): Don't quote special files.
2019-04-23 18:29:10 +02:00
Akim Demaille
bbf37f2534 lalr: fix segmentation violation
The "includes" relation [DeRemer 1982] is between gotos, so of course,
for a given goto, there cannot be more that ngotos (number of gotos)
images.  But we manipulate the set of images of a goto as a list,
without checking that an image was not already introduced.  So we can
"register" way more images than ngotos, leading to a crash (heap
buffer overflow).

Reported by wcventure.
http://lists.gnu.org/archive/html/bug-bison/2019-03/msg00007.html

For the records, this bug is present in the first committed version of
Bison.

* src/lalr.c (build_relations): Don't insert the same goto several
times.
* tests/sets.at (Build Relations): New.
2019-03-30 10:10:39 +01:00
Akim Demaille
6289d673a0 examples: add an example with a reentrant parser in Flex+Bison
Suggested by Eric S. Raymond.
https://lists.gnu.org/archive/html/bison-patches/2019-02/msg00066.html

* examples/c/reentrant-calc/Makefile, examples/c/reentrant-calc/README.md,
* examples/c/reentrant-calc/parse.y, examples/c/reentrant-calc/scan.l
* examples/c/reentrant-calc/lexcalc.test,
* examples/c/reentrant-calc/local.mk:
New.
2019-02-17 11:31:51 +01:00
Akim Demaille
cacdfc2f6e gram: fix handling of nterms in actions when some are unused
Since Bison 3.3, semantic values in rule actions (i.e., '$...') are
passed to the m4 backend as the symbol number.  Unfortunately, when
there are unused symbols, the symbols are renumbered _after_ the
numbers were used in the rule actions.  As a result, the evaluation of
the skeleton failed because it used non existing symbol numbers.
Which is the happy scenario: we could use numbers of other existing
symbols...

Reported by Balázs Scheidler.
http://lists.gnu.org/archive/html/bug-bison/2019-01/msg00044.html

Translating the rule actions after the symbol renumbering moves too
many parts in bison.  Relying on the symbol identifiers is more
troublesome than it might first seem: some don't have an
identifier (tokens with only a literal string), some might have a
complex one (tokens with a literal string with characters special for
M4).  Well, these are tokens, but nterms also have issues: "dummy"
nterms (for midrule actions) are named $@32 etc. which is risky for
M4.

Instead, let's simply give M4 the mapping between the old numbers and
the new ones.  To avoid confusion between old and new numbers, always
emit pre-renumbering numbers as "orig NUM".

* data/README: Give details about "orig NUM".
* data/skeletons/bison.m4 (__b4_symbol, _b4_symbol): Resolve the
"orig NUM".
* src/output.c (prepare_symbol_definitions): Pass nterm_map to m4.
* src/reduce.h, src/reduce.c (nterm_map): Extract it from
nonterminals_reduce, to make it public.
(reduce_free): Free it.
* src/scan-code.l (handle_action_dollar): When referring to a nterm,
use "orig NUM".
* tests/reduce.at (Useless Parts): New, based Balázs Scheidler's
report.
2019-02-03 10:05:53 +01:00
Akim Demaille
2471733f1a package: bump copyrights to 2019 2019-01-05 14:58:05 +01:00
Akim Demaille
a4ede8f85b package: make bison a relocatable package
Suggested by David Barto
https://lists.gnu.org/archive/html/help-bison/2015-02/msg00004.html
and Victor Zverovich.
https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00121.html

This is very easy to do, thanks to work by Bruno Haible in gnulib.
See "Supporting Relocation" in gnulib's documentation.

* bootstrap.conf: We need relocatable-prog and relocatable-script (for yacc).

* src/yacc.in: New.
* configure.ac, src/local.mk: Instantiate it.
* src/main.c, src/output.c (main, pkgdatadir): Use relocatable2.

* doc/bison.texi (FAQ): Document it.
2018-12-25 10:05:36 +01:00