Merge branch 'maint'

* origin/maint:
  NEWS: warnings with clang
  warnings: avoid warnings from clang
  tests: no longer disable -O compiler options
  yacc.c: initialize yylval in pure-parser mode
  skeletons: style changes
  lalr1.cc: document exception safety
  lalr1.cc: check exception safety of error handling
  lalr1.cc: check (and fix) %printer exception safety
  lalr1.cc: check (and fix) %initial-action exception safety
  lalr1.cc: fix exception safety
  lalr1.cc: check exception safety.
  lalr1.cc: indentation fixes.
  lalr1.cc: don't leave macros define to nothing
  tests: minor improvements
  tests: use $PERL instead of perl
  build: look for Perl in configure.
  tests: fix sed portability issues
  tests: diff -u is not portable

Conflicts:
	data/c.m4
	data/glr.c
	data/lalr1.cc
	data/yacc.c
	doc/Makefile.am
	tests/atlocal.in
	tests/calc.at
This commit is contained in:
Akim Demaille
2012-10-10 17:31:25 +02:00
18 changed files with 388 additions and 71 deletions

View File

@@ -172,6 +172,28 @@ m4_define([b4_declare_scanner_communication_variables], [[
/* The lookahead symbol. */
int yychar;
]b4_pure_if([[
#if defined __GNUC__ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__))
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_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
or non-GCC compilers. */
static YYSTYPE yyval_default;
# define YYLVAL_INITIALIZE() (yylval = yyval_default)
#endif]])[
#ifndef YYLVAL_INITIALIZE
# define YYLVAL_INITIALIZE()
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;]b4_locations_if([[
@@ -397,19 +419,19 @@ typedef short int yytype_int16;
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# define YY_(Msgid) Msgid
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#ifdef __GNUC__
# define YYUSE(e) ((void) (e))
# define YYUSE(E) ((void) (E))
#else
# define YYUSE(e) /* empty */
# define YYUSE(E) /* empty */
#endif
#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[
@@ -602,13 +624,13 @@ static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
#define YYPACT_NINF ]b4_pact_ninf[
#define yypact_value_is_default(yystate) \
]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
#define yypact_value_is_default(Yystate) \
]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[
#define YYTABLE_NINF ]b4_table_ninf[
#define yytable_value_is_error(yytable_value) \
]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
#define yytable_value_is_error(Yytable_value) \
]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[
]b4_parser_tables_define[
@@ -1454,8 +1476,9 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;]b4_locations_if([[
yylsp = yyls;
yylsp = yyls;]])[
YYLVAL_INITIALIZE ();]b4_locations_if([[
#if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
@@ -1641,7 +1664,9 @@ yyread_pushed_token:]])[
YY_LAC_DISCARD ("shift");]])[
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
]b4_locations_if([ *++yylsp = yylloc;])[
goto yynewstate;
@@ -1861,7 +1886,9 @@ yyerrlab1:
current lookahead token, the shift below will for sure. */
YY_LAC_DISCARD ("error recovery");]])[
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
]b4_locations_if([[
yyerror_range[2] = yylloc;
/* Using YYLLOC is tempting, but would change the location of