Reported by Andre da Costa Barros.
https://savannah.gnu.org/patch/?9716
* examples/calc++/local.mk: We no longer generate position.hh and
stack.hh. Leaving them here triggers their concurrent generation,
which fails.
(%C%_calc___CPPFLAGS): Fix the extracted headers in the source tree.
* examples/mfcalc/local.mk (%C%_mfcalc_CPPFLAGS): Ditto.
Currently, the examples are extracted on the user's side.
Unfortunately, that requires that the user has Perl, which is
otherwise not needed for Bison. Let's ship the examples instead.
The examples were handled this way so that we could depend on
configure flags: if --enable-gcc-warnings is passed, it is understood
as "I'm a maintainer", so the examples are generated with `#line`s.
Regular users should not see them, so they are now unconditionally
removed when rolling a tarball.
Reported by Mike Frysinger.
https://lists.gnu.org/archive/html/bison-patches/2015-04/msg00000.html
* examples/local.mk: Ship all the extracted files.
(examples-unline): New.
Make sure that the generated tarballs do not contain the #lines.
Also, make sure that `make dist` generates a correct tarball even if
the C++ compiler does not work.
Reported by Nelson H. F. Beebe.
* m4/cxx.m4 (BISON_CXX_WORKS): Define to true/false instead of
true/exit 77. The latter is too dangerous to use (it directly quits).
(ENABLE_CXX): New name for the Automake conditional, for consistency
with ENABLE_CXX11 etc.
* tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Adjust to the new
semantics of BISON_CXX_WORKS.
* examples/c++/local.mk: Skip the variant test if C++ does not work.
* examples/calc++/local.mk: Likewise.
On some systems (x86_64-pc-solaris2.11), with Developer Studio 12.5's
CC, we get:
".../include/CC/Cstd/vector.cc", line 127: Error: Cannot assign const yy::parser::stack_symbol_type to yy::parser::stack_symbol_type without "yy::parser::stack_symbol_type::operator=(const yy::parser::stack_symbol_type&)";.
".../include/CC/Cstd/vector", line 475: Where: While instantiating "std::vector<yy::parser::stack_symbol_type>::__insert_aux(yy::parser::stack_symbol_type*, const yy::parser::stack_symbol_type&)".
".../include/CC/Cstd/vector", line 475: Where: Instantiated from non-template code.
1 Error(s) detected.
Don't expect __cplusplus to be always defined. If it's not, consider
this is C++98.
Reported by Nelson H. F. Beebe.
* data/c++.m4, data/lalr1.cc, examples/c++/variant.yy, tests/local.at,
* tests/testsuite.h:
An undefined __cplusplus means pre C++11.
On some systems, we don't use our getopt. As a consequence the error
messages vary:
$ bison --skeleton
bison: option requires an argument -- skeleton
Try 'bison --help' for more information.
instead of
bison: option '--skeleton' requires an argument
Try 'bison --help' for more information.
Reported by Jannick and Nelson H. F. Beebe.
https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00140.html
* tests/input.at (Invalid number of arguments): work around getopt
portability issues.
On Solaris, GCC 7.3 defines:
-std=c++14 -std=c++17
__cplusplus 201402L 201703L
__STDC_VERSION__ 199901L 201112L
So the current #definition of _Noreturn sees that 201112 <=
__STDC_VERSION__, i.e., that C11 is supported, so it expects _Noreturn
to be supported. Apparently it is not.
This is only for C++, the test suite works for C. However, the test
suite does not try several C standards, maybe we should...
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00064.html
* data/c.m4 (b4_attribute_define): Define _Noreturn as [[noreturn]] in
modern C++.
Does not work on Solaris 11.3 x86/64:
479. c++.at:1293: testing C++ GLR parser identifier shadowing ...
======== Testing with C++ standard flags: '-std=c++17'
./c++.at:1332: $BISON_CXX_WORKS
stderr:
stdout:
./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
stderr:
input.cc:837:8: error: '_Noreturn' does not name a type
static _Noreturn void
^~~~~~~~~
input.cc:845:8: error: '_Noreturn' does not name a type
static _Noreturn void
^~~~~~~~~
Reported by Kiyoshi Kanazawa.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00051.html
* data/c.m4 (b4_attribute_define): Use the snippet which is currently
in gnulib's m4/gnulib-common.m4 (which seems a little more advanced
than lib/_Noreturn.h).
The "Report translation bugs to..." part of --help is issued only on
glibc systems. So if the tarball is not wrapped on such a system, and
used on such a system (or the converse), then bison.help will differ
on the user's system, and help2man will be called to update bison.1.
But help2man should not be a requirement.
Reported by Alexandre Duret-Lutz.
* doc/local.mk (doc/bison.help): Remove the possible doc about
translation bugs.
Pass LC_ALL=C, as reported in src/getargs.c's usage().
(doc/cross-options.texi): Use bison.help instead of calling bison
--help.
Some users rely on this sentence to know that the file can be ignored.
Reported by Alexandre Duret-Lutz.
* data/bison.m4 (b4_generated_by): New.
(b4_copyright): Use it.
* data/location.cc, data/stack.hh: Use it too, for the stub files
(position.hh and stack.hh).
* doc/bison.texi (Calc++ Scanner): Show how exception can be thrown
from auxiliary functions.
Clarify the meaning of the various flex %options we use.
Get rid of a warning.
(Calc++ Parsing Driver): Use the parser as a functor.
* doc/bison.texi: Simplify wording.
Fix Texinfo error.
(Complete Symbols): Handle the token EOF.
(Calc++ Parser): In the modern C++ world, prefer assignment to swap.
(Strings are Destroyed): Prefer an explicit 'continue' to a comment.
The CI is using Flex 2.5.35. And ICC is too picky for it. Let's stop
making these warnings errors. I wish I could disable them in the
source files using the ICC version and the Flex version, but ICC's
pragma support is unclear, and I'm tired of fighting it.
* configure.ac (FLEX_SCANNER_CXXFLAGS): Make warnings warnings.
* examples/c++/local.mk: Comment changes.