Compare commits

..
9 Commits
Author SHA1 Message Date
Akim Demaille 534497f54b version 3.0
* NEWS: Record release date.
2013-07-25 17:55:58 +02:00
Akim Demaille a62a7b014c regen 2013-07-25 17:55:32 +02:00
Akim Demaille de1a2f20dd news: prepare 3.0
* NEWS (3.0): Reorder.
2013-07-25 17:53:59 +02:00
Akim Demaille afcc58c63e tests: fix invalid assignment when using variants in C++11
* tests/c++.at (Exception safety): In variant mode $$ is an instance
of Object.  Assigning YY_NULL in C++98 is incorrect, but behaves ok,
as it assigns YY_NULL=0 using Object::operator= (char v).  It is wrong
in C++11 as there is operator for "$$ = nullptr".
2013-07-25 17:53:59 +02:00
Akim Demaille d3ae5af6ec yacc: beware of "uninitialized uses" warnings
Again some issues with the fact that yylval is reported by GCC as
possibly not initialized in some cases.  Here, the case at hand is the
%destructor.

I am still not convinced that it is worth going all the trouble of
using pragmas to disable temporarily some warnings, instead of just
initializing the looking symbol once for all, but that's what Paul
voted for, see
<http://lists.gnu.org/archive/html/bison-patches/2012-10/msg00050.html>.

* data/c.m4 (b4_attribute_define): Define
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END,
YY_INITIAL_VALUE here, as we will need them in the generation of the
destructor function, which is defined in yacc.c before yyparse, which
was in charge of defining these macros.
* data/yacc.c (b4_declare_scanner_communication_variables): Simplify:
trying to factor the definitions of the case pure and impure is
too complex.
Actually, it is not even clear that this macro should really exist,
as even the calls are complex.
Be careful not to issue a lone ";", as this is a statement, and C90
forbids declarations after statements ; so write
"YY_INITIAL_VALUE(Decl;)", not "YY_INITIAL_VALUE(Decl);".
2013-07-25 17:53:59 +02:00
Akim Demaille 41dfa1cbf0 gnulib: update 2013-07-25 13:47:01 +02:00
Akim Demaille b7171c45f4 tests: skip C++ tests if we can't compile a simple program
There are possible conflicts between gnulib replacement functions (in
<stdio.h>) and their C++ wrappers (in <stream>).  Trying to address
these in configure seems too hard, and I don't know how to fix the issue
in gnulib.  Cowardly avoid the problem by skipping C++ tests when this
happens.
Reported by Stefano Lattarini.
http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html

* tests/atlocal.in (BISON_CXX_WORKS): Also set it to "skip" if we can't
compile a simple program using <stream>.
* tests/local.at: Comment changes.
2013-07-03 17:18:54 +02:00
Akim Demaille ac953ff80a tests: fix 'find' portability issues
Reported by Stefano Lattarini.
http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00000.html

* tests/output.at (AT_CHECK_OUTPUT): Use Perl instead.
2013-07-03 08:39:41 +02:00
Akim Demaille facb910cbd maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-06-24 10:29:36 +02:00
12 changed files with 401 additions and 360 deletions
+1 -1
View File
@@ -1 +1 @@
2.7.90 2.7.91
+4 -8
View File
@@ -1,13 +1,6 @@
GNU Bison NEWS GNU Bison NEWS
* Noteworthy changes in release 2.7.91 (2013-06-24) [beta] * Noteworthy changes in release 3.0 (2013-07-25) [stable]
** Java skeleton improvements
The Java skeleton now supports push parsing.
Contributed by Dennis Heimbigner.
* Noteworthy changes in release 2.7.90 (2013-05-30) [beta]
** WARNING: Future backward-incompatibilities! ** WARNING: Future backward-incompatibilities!
@@ -528,6 +521,9 @@ GNU Bison NEWS
and "%define init_throws". and "%define init_throws".
Contributed by Paolo Bonzini. Contributed by Paolo Bonzini.
The Java skeleton now supports push parsing.
Contributed by Dennis Heimbigner.
** C++ skeletons improvements ** C++ skeletons improvements
*** The parser header is no longer mandatory (lalr1.cc, glr.cc) *** The parser header is no longer mandatory (lalr1.cc, glr.cc)
+20 -13
View File
@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Print a version string. # Print a version string.
scriptversion=2013-05-08.20; # UTC scriptversion=2013-07-03.20; # UTC
# Bootstrap this package from checked-out sources. # Bootstrap this package from checked-out sources.
@@ -256,12 +256,12 @@ esac
# Extra files from gnulib, which override files from other sources. # Extra files from gnulib, which override files from other sources.
test -z "${gnulib_extra_files}" && \ test -z "${gnulib_extra_files}" && \
gnulib_extra_files=" gnulib_extra_files="
$build_aux/install-sh build-aux/install-sh
$build_aux/mdate-sh build-aux/mdate-sh
$build_aux/texinfo.tex build-aux/texinfo.tex
$build_aux/depcomp build-aux/depcomp
$build_aux/config.guess build-aux/config.guess
$build_aux/config.sub build-aux/config.sub
doc/INSTALL doc/INSTALL
" "
@@ -551,7 +551,7 @@ fi
echo "$0: Bootstrapping from checked-out $package sources..." echo "$0: Bootstrapping from checked-out $package sources..."
# See if we can use gnulib's git-merge-changelog merge driver. # See if we can use gnulib's git-merge-changelog merge driver.
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then if $use_git && test -d .git && (git --version) >/dev/null 2>/dev/null ; then
if git config merge.merge-changelog.driver >/dev/null ; then if git config merge.merge-changelog.driver >/dev/null ; then
: :
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
@@ -574,13 +574,17 @@ git_modules_config () {
test -f .gitmodules && git config --file .gitmodules "$@" test -f .gitmodules && git config --file .gitmodules "$@"
} }
gnulib_path=$(git_modules_config submodule.gnulib.path) if $use_git; then
test -z "$gnulib_path" && gnulib_path=gnulib gnulib_path=$(git_modules_config submodule.gnulib.path)
test -z "$gnulib_path" && gnulib_path=gnulib
fi
# Get gnulib files. # Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
# submodule, for use in the rest of the script.
case ${GNULIB_SRCDIR--} in case ${GNULIB_SRCDIR--} in
-) -)
# Note that $use_git is necessarily true in this case.
if git_modules_config submodule.gnulib.url >/dev/null; then if git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..." echo "$0: getting gnulib files..."
git submodule init || exit $? git submodule init || exit $?
@@ -601,8 +605,8 @@ case ${GNULIB_SRCDIR--} in
GNULIB_SRCDIR=$gnulib_path GNULIB_SRCDIR=$gnulib_path
;; ;;
*) *)
# Use GNULIB_SRCDIR as a reference. # Use GNULIB_SRCDIR directly or as a reference.
if test -d "$GNULIB_SRCDIR"/.git && \ if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
git_modules_config submodule.gnulib.url >/dev/null; then git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..." echo "$0: getting gnulib files..."
if git submodule -h|grep -- --reference > /dev/null; then if git submodule -h|grep -- --reference > /dev/null; then
@@ -628,6 +632,9 @@ case ${GNULIB_SRCDIR--} in
;; ;;
esac esac
# $GNULIB_SRCDIR now points to the version of gnulib to use, and
# we no longer need to use git or $gnulib_path below here.
if $bootstrap_sync; then if $bootstrap_sync; then
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || { cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
echo "$0: updating bootstrap and restarting..." echo "$0: updating bootstrap and restarting..."
+24 -3
View File
@@ -221,6 +221,25 @@ m4_define([b4_attribute_define],
#else #else
# define YYUSE(E) /* empty */ # define YYUSE(E) /* empty */
#endif #endif
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
]) ])
@@ -446,7 +465,9 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
yymsg = "Deleting"; yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
]b4_symbol_actions([destructor])[ ]b4_symbol_actions([destructor])[
YY_IGNORE_MAYBE_UNINITIALIZED_END
}]dnl }]dnl
]) ])
@@ -456,9 +477,9 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
# Define the "yy_symbol_print" function. # Define the "yy_symbol_print" function.
m4_define_default([b4_yy_symbol_print_define], m4_define_default([b4_yy_symbol_print_define],
[[ [[
/*--------------------------------. /*----------------------------------------.
| Print this symbol on YYOUTPUT. | | Print this symbol's value on YYOUTPUT. |
`--------------------------------*/ `----------------------------------------*/
]b4_function_define([yy_symbol_value_print], ]b4_function_define([yy_symbol_value_print],
[static void], [static void],
+9 -26
View File
@@ -175,36 +175,19 @@ m4_define([b4_declare_scanner_communication_variables], [[
int yychar; int yychar;
]b4_pure_if([[ ]b4_pure_if([[
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* The semantic value of the lookahead symbol. */
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
/* Default value used for initialization, for pacifying older GCCs /* Default value used for initialization, for pacifying older GCCs
or non-GCC compilers. */ or non-GCC compilers. */
static YYSTYPE yyval_default; YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
# define YY_INITIAL_VALUE(Value) = Value YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);]b4_locations_if([[
#endif]b4_locations_if([[
static YYLTYPE yyloc_default][]b4_yyloc_default[;]])])[
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval YY_INITIAL_VALUE (yyval_default);]b4_locations_if([[
/* Location data for the lookahead symbol. */ /* Location data for the lookahead symbol. */
YYLTYPE yylloc]b4_pure_if([ = yyloc_default], [b4_yyloc_default])[; static YYLTYPE yyloc_default]b4_yyloc_default[;
]])b4_pure_if([], [[ YYLTYPE yylloc = yyloc_default;]])],
[[/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;]b4_locations_if([[
/* Location data for the lookahead symbol. */
YYLTYPE yylloc]b4_yyloc_default[;]])[
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
int yynerrs;]])]) int yynerrs;]])])
+1 -1
Submodule gnulib updated: e28fbd787c...03e96cc338
+282 -281
View File
File diff suppressed because it is too large Load Diff
+17 -17
View File
@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 2.7.90. */ /* A Bison parser, made by GNU Bison 3.0. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
@@ -48,11 +48,11 @@
extern int gram_debug; extern int gram_debug;
#endif #endif
/* "%code requires" blocks. */ /* "%code requires" blocks. */
#line 21 "src/parse-gram.y" /* yacc.c:1926 */ #line 21 "src/parse-gram.y" /* yacc.c:1909 */
#include "symlist.h" #include "symlist.h"
#include "symtab.h" #include "symtab.h"
#line 221 "src/parse-gram.y" /* yacc.c:1926 */ #line 221 "src/parse-gram.y" /* yacc.c:1909 */
typedef enum typedef enum
{ {
@@ -61,10 +61,10 @@ extern int gram_debug;
param_parse = 1 << 1, param_parse = 1 << 1,
param_both = param_lex | param_parse param_both = param_lex | param_parse
} param_type; } param_type;
#line 645 "src/parse-gram.y" /* yacc.c:1926 */ #line 645 "src/parse-gram.y" /* yacc.c:1909 */
#include "muscle-tab.h" #include "muscle-tab.h"
#line 68 "src/parse-gram.h" /* yacc.c:1926 */ #line 68 "src/parse-gram.h" /* yacc.c:1909 */
/* Token type. */ /* Token type. */
#ifndef GRAM_TOKENTYPE #ifndef GRAM_TOKENTYPE
@@ -135,27 +135,27 @@ extern int gram_debug;
typedef union GRAM_STYPE GRAM_STYPE; typedef union GRAM_STYPE GRAM_STYPE;
union GRAM_STYPE union GRAM_STYPE
{ {
#line 182 "src/parse-gram.y" /* yacc.c:1926 */ #line 182 "src/parse-gram.y" /* yacc.c:1909 */
unsigned char character; unsigned char character;
#line 186 "src/parse-gram.y" /* yacc.c:1926 */ #line 186 "src/parse-gram.y" /* yacc.c:1909 */
char *code; char *code;
#line 191 "src/parse-gram.y" /* yacc.c:1926 */ #line 191 "src/parse-gram.y" /* yacc.c:1909 */
uniqstr uniqstr; uniqstr uniqstr;
#line 199 "src/parse-gram.y" /* yacc.c:1926 */ #line 199 "src/parse-gram.y" /* yacc.c:1909 */
int integer; int integer;
#line 203 "src/parse-gram.y" /* yacc.c:1926 */ #line 203 "src/parse-gram.y" /* yacc.c:1909 */
symbol *symbol; symbol *symbol;
#line 208 "src/parse-gram.y" /* yacc.c:1926 */ #line 208 "src/parse-gram.y" /* yacc.c:1909 */
assoc assoc; assoc assoc;
#line 211 "src/parse-gram.y" /* yacc.c:1926 */ #line 211 "src/parse-gram.y" /* yacc.c:1909 */
symbol_list *list; symbol_list *list;
#line 214 "src/parse-gram.y" /* yacc.c:1926 */ #line 214 "src/parse-gram.y" /* yacc.c:1909 */
named_ref *named_ref; named_ref *named_ref;
#line 241 "src/parse-gram.y" /* yacc.c:1926 */ #line 241 "src/parse-gram.y" /* yacc.c:1909 */
param_type param; param_type param;
#line 409 "src/parse-gram.y" /* yacc.c:1926 */ #line 409 "src/parse-gram.y" /* yacc.c:1909 */
code_props_type code_type; code_props_type code_type;
#line 647 "src/parse-gram.y" /* yacc.c:1926 */ #line 647 "src/parse-gram.y" /* yacc.c:1909 */
struct struct
{ {
@@ -163,7 +163,7 @@ code_props_type code_type;
muscle_kind kind; muscle_kind kind;
} value; } value;
#line 167 "src/parse-gram.h" /* yacc.c:1926 */ #line 167 "src/parse-gram.h" /* yacc.c:1909 */
}; };
# define GRAM_STYPE_IS_TRIVIAL 1 # define GRAM_STYPE_IS_TRIVIAL 1
# define GRAM_STYPE_IS_DECLARED 1 # define GRAM_STYPE_IS_DECLARED 1
+31
View File
@@ -50,6 +50,37 @@ CXXFLAGS="$NO_WERROR_CXXFLAGS @WERROR_CXXFLAGS@"
# If 'exit 77'; skip all C++ tests; otherwise ':'. # If 'exit 77'; skip all C++ tests; otherwise ':'.
BISON_CXX_WORKS='@BISON_CXX_WORKS@' BISON_CXX_WORKS='@BISON_CXX_WORKS@'
# Be sure that the C++ compiler is not broken because of gnulib. This
# cannot be checked in configure (gnulib is not parameterized yet),
# and checking this in every C++ test in AC_COMPILE_CXX is too costly.
#
# http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html
#
# FIXME: Check (say 2014) whether this is still needed.
if $BISON_CXX_WORKS; then
# See AT_DATA_SOURCE_PROLOGUE.
cat >conftest.cc <<EOF
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
#include <iostream>
int main ()
{
std::cout << "Works" << std::endl;
}
EOF
ls
$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS -o conftest conftest.cc
case $? in
0);;
*) BISON_CXX_WORKS="as_fn_error 77 cannot-compile-simple-program";;
esac
rm -f conftest*
fi
# Whether the compiler supports POSIXLY_CORRECT defined. # Whether the compiler supports POSIXLY_CORRECT defined.
: ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'} : ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'}
: ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'} : ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'}
+3 -3
View File
@@ -795,11 +795,11 @@ item:
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and // Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test. // then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE($][1); $][$ = $][2; } | 'E' 'a' { YYUSE($][1); $][$ = $][2; }
| 'R' { $][$ = YY_NULL; ]AT_VARIANT_IF([], [delete $][1]; )[YYERROR; } | 'R' { ]AT_VARIANT_IF([], [$][$ = YY_NULL; delete $][1]; )[YYERROR; }
| 'p' { $][$ = $][1; } | 'p' { $][$ = $][1; }
| 's' { $][$ = $][1; throw std::runtime_error ("reduction"); } | 's' { $][$ = $][1; throw std::runtime_error ("reduction"); }
| 'T' { $][$ = YY_NULL; ]AT_VARIANT_IF([], [delete $][1]; )[YYABORT; } | 'T' { ]AT_VARIANT_IF([], [$][$ = YY_NULL; delete $][1]; )[YYABORT; }
| error { $][$ = YY_NULL; yyerrok; } | error { ]AT_VARIANT_IF([], [$][$ = YY_NULL; ])[yyerrok; }
; ;
%% %%
+4 -3
View File
@@ -339,9 +339,9 @@ m4_define([AT_LANG_DISPATCH],
# AT_DATA_SOURCE_PROLOGUE # AT_DATA_SOURCE_PROLOGUE
# ------------------------ # -----------------------
# The prologue that should be included in any source code that is # The prologue that should be included in any source code that is
# meant to be compiled. # meant to be compiled. Keep atlocal.in sync (BISON_CXX_WORKS).
m4_define([AT_DATA_SOURCE_PROLOGUE], m4_define([AT_DATA_SOURCE_PROLOGUE],
[[#include <config.h> [[#include <config.h>
/* We don't need perfect functions for these tests. */ /* We don't need perfect functions for these tests. */
@@ -754,6 +754,7 @@ AT_CHECK(m4_join([ ],
[m4_bmatch([$1], [[.]], [], [$LIBS])]), [m4_bmatch([$1], [[.]], [], [$LIBS])]),
0, [ignore], [ignore])]) 0, [ignore], [ignore])])
# AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.cc]) # AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.cc])
# --------------------------------------------- # ---------------------------------------------
# Compile SOURCES into OUTPUT. If the C++ compiler does not work, # Compile SOURCES into OUTPUT. If the C++ compiler does not work,
@@ -761,7 +762,7 @@ AT_CHECK(m4_join([ ],
# #
# If OUTPUT does not contain '.', assume that we are linking too, # If OUTPUT does not contain '.', assume that we are linking too,
# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT # otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT
# with trailing .o removed, and ".cc" appended. # with trailing ".o" removed, and ".cc" appended.
m4_define([AT_COMPILE_CXX], m4_define([AT_COMPILE_CXX],
[AT_KEYWORDS(c++) [AT_KEYWORDS(c++)
AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore) AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore)
+5 -4
View File
@@ -37,10 +37,11 @@ foo: {};
]AT_BISON_CHECK([$3 $1 $5], 0)[ ]AT_BISON_CHECK([$3 $1 $5], 0)[
# Ignore the files non-generated files # Ignore the files non-generated files
]AT_CHECK([find . -type f -and -not -path './$1' -and -not -path './testsuite.log' | ]AT_CHECK([[find . -type f |
sed 's,\./,,' | $PERL -ne '
sort | s,\./,,; chomp;
xargs echo], push @file, $_ unless m{^($1|testsuite.log)$};
END { print join (" ", sort @file), "\n" }']],
[], [$4 [], [$4
])[ ])[
]$6[ ]$6[