mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 02:03:03 +00:00
Minor fixups to get 'make maintainer-check' to work.
* configure.ac: Don't use -Wnested-externs, as it's incompatible with the new verify.h implementation. * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput). * data/glr.c (YYUSE): Depend on __GNUC__ as well. * data/yacc.c (YYUSE): Likewise. * data/lalr1.cc (yysyntax_error_): YYUSE (yystate). * lib/subpipe.c (end_of_output_subpipe): The args are unused. * src/parse-gram.y (declaration): Don't pass a string constant to a function that expects char *, since GCC might complain about the constant value. * src/reader.c (symbol_typed_p): Add parens to pacify GCC. * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval before #defining them. * tests/glr-regression.at (Incorrectly initialized location for empty right-hand side in GLR): In yyerror, use the msg arg. (Corrupted semantic options if user action cuts parse): (Incorrect lookahead during deterministic GLR): (Incorrect lookahead during nondeterministic GLR): Don't name a local var 'index'; it shadows string.h's 'index'.
This commit is contained in:
24
ChangeLog
24
ChangeLog
@@ -1,3 +1,27 @@
|
|||||||
|
2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
Minor fixups to get 'make maintainer-check' to work.
|
||||||
|
* configure.ac: Don't use -Wnested-externs, as it's incompatible
|
||||||
|
with the new verify.h implementation.
|
||||||
|
* data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
|
||||||
|
* data/glr.c (YYUSE): Depend on __GNUC__ as well.
|
||||||
|
* data/yacc.c (YYUSE): Likewise.
|
||||||
|
* data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
|
||||||
|
* lib/subpipe.c (end_of_output_subpipe): The args are unused.
|
||||||
|
* src/parse-gram.y (declaration): Don't pass a string constant
|
||||||
|
to a function that expects char *, since GCC might complain
|
||||||
|
about the constant value.
|
||||||
|
* src/reader.c (symbol_typed_p): Add parens to pacify GCC.
|
||||||
|
* tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
|
||||||
|
before #defining them.
|
||||||
|
* tests/glr-regression.at
|
||||||
|
(Incorrectly initialized location for empty right-hand side in GLR):
|
||||||
|
In yyerror, use the msg arg.
|
||||||
|
(Corrupted semantic options if user action cuts parse):
|
||||||
|
(Incorrect lookahead during deterministic GLR):
|
||||||
|
(Incorrect lookahead during nondeterministic GLR):
|
||||||
|
Don't name a local var 'index'; it shadows string.h's 'index'.
|
||||||
|
|
||||||
2006-01-19 Akim Demaille <akim@epita.fr>
|
2006-01-19 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
|
* tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -58,7 +59,6 @@ if test "${enableval}" = yes; then
|
|||||||
BISON_WARNING(-Wbad-function-cast)
|
BISON_WARNING(-Wbad-function-cast)
|
||||||
BISON_WARNING(-Wmissing-declarations)
|
BISON_WARNING(-Wmissing-declarations)
|
||||||
BISON_WARNING(-Wmissing-prototypes)
|
BISON_WARNING(-Wmissing-prototypes)
|
||||||
BISON_WARNING(-Wnested-externs)
|
|
||||||
BISON_WARNING(-Wshadow)
|
BISON_WARNING(-Wshadow)
|
||||||
BISON_WARNING(-Wstrict-prototypes)
|
BISON_WARNING(-Wstrict-prototypes)
|
||||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
||||||
|
|||||||
@@ -472,6 +472,8 @@ b4_parse_param_use[]dnl
|
|||||||
[# ifdef YYPRINT
|
[# ifdef YYPRINT
|
||||||
if (yytype < YYNTOKENS)
|
if (yytype < YYNTOKENS)
|
||||||
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
||||||
|
# else
|
||||||
|
YYUSE (yyoutput);
|
||||||
# endif
|
# endif
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ b4_syncline([@oline@], [@ofile@])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Suppress unused-variable warnings by "using" E. */
|
/* Suppress unused-variable warnings by "using" E. */
|
||||||
#ifndef lint
|
#if !defined (lint) || defined (__GNUC__)
|
||||||
# define YYUSE(e) ((void) (e))
|
# define YYUSE(e) ((void) (e))
|
||||||
#else
|
#else
|
||||||
# define YYUSE(e) /* empty */
|
# define YYUSE(e) /* empty */
|
||||||
@@ -1103,7 +1103,7 @@ yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState)
|
|||||||
|
|
||||||
/** Add a new semantic action that will execute the action for rule
|
/** Add a new semantic action that will execute the action for rule
|
||||||
* RULENUM on the semantic values in RHS to the list of
|
* RULENUM on the semantic values in RHS to the list of
|
||||||
* alternative actions for STATE. Assumes that RHS comes from
|
* alternative actions for STATE. Assumes that RHS comes from
|
||||||
* stack #K of *STACKP. */
|
* stack #K of *STACKP. */
|
||||||
static void
|
static void
|
||||||
yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
|
yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
|
||||||
@@ -1536,7 +1536,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
|||||||
yybool* yynewLookaheadNeeds;
|
yybool* yynewLookaheadNeeds;
|
||||||
|
|
||||||
yynewStates = NULL;
|
yynewStates = NULL;
|
||||||
|
|
||||||
if (yystackp->yytops.yycapacity
|
if (yystackp->yytops.yycapacity
|
||||||
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
|
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
|
||||||
yyMemoryExhausted (yystackp);
|
yyMemoryExhausted (yystackp);
|
||||||
|
|||||||
@@ -829,6 +829,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
b4_error_verbose_if([, int tok])[)
|
b4_error_verbose_if([, int tok])[)
|
||||||
{
|
{
|
||||||
std::string res;
|
std::string res;
|
||||||
|
YYUSE (yystate);
|
||||||
#if YYERROR_VERBOSE
|
#if YYERROR_VERBOSE
|
||||||
int yyn = yypact_[yystate];
|
int yyn = yypact_[yystate];
|
||||||
if (yypact_ninf_ < yyn && yyn < yylast_)
|
if (yypact_ninf_ < yyn && yyn < yylast_)
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ b4_syncline([@oline@], [@ofile@])[
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Suppress unused-variable warnings by "using" E. */
|
/* Suppress unused-variable warnings by "using" E. */
|
||||||
#ifndef lint
|
#if !defined (lint) || defined (__GNUC__)
|
||||||
# define YYUSE(e) ((void) (e))
|
# define YYUSE(e) ((void) (e))
|
||||||
#else
|
#else
|
||||||
# define YYUSE(e) /* empty */
|
# define YYUSE(e) /* empty */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -71,6 +71,18 @@
|
|||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
#define _(Msgid) gettext (Msgid)
|
#define _(Msgid) gettext (Msgid)
|
||||||
|
|
||||||
|
#ifndef __attribute__
|
||||||
|
/* This feature is available in gcc versions 2.5 and later. */
|
||||||
|
# if !defined (__GNUC__) || __GNUC__ < 2 || \
|
||||||
|
(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||||
|
# define __attribute__(Spec) /* empty */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ATTRIBUTE_UNUSED
|
||||||
|
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Initialize this module. */
|
/* Initialize this module. */
|
||||||
|
|
||||||
@@ -168,6 +180,7 @@ reap_subpipe (pid_t pid, char const *program)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
end_of_output_subpipe (pid_t pid, int fd[2])
|
end_of_output_subpipe (pid_t pid ATTRIBUTE_UNUSED,
|
||||||
|
int fd[2] ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,11 @@ declaration:
|
|||||||
grammar_declaration
|
grammar_declaration
|
||||||
| PROLOGUE { prologue_augment ($1, @1); }
|
| PROLOGUE { prologue_augment ($1, @1); }
|
||||||
| "%debug" { debug_flag = true; }
|
| "%debug" { debug_flag = true; }
|
||||||
| "%define" string_content { muscle_insert ($2, "1"); }
|
| "%define" string_content
|
||||||
|
{
|
||||||
|
static char one[] = "1";
|
||||||
|
muscle_insert ($2, one);
|
||||||
|
}
|
||||||
| "%define" string_content string_content { muscle_insert ($2, $3); }
|
| "%define" string_content string_content { muscle_insert ($2, $3); }
|
||||||
| "%defines" { defines_flag = true; }
|
| "%defines" { defines_flag = true; }
|
||||||
| "%error-verbose" { error_verbose = true; }
|
| "%error-verbose" { error_verbose = true; }
|
||||||
@@ -214,14 +218,14 @@ declaration:
|
|||||||
| "%expect-rr" INT { expected_rr_conflicts = $2; }
|
| "%expect-rr" INT { expected_rr_conflicts = $2; }
|
||||||
| "%file-prefix" "=" string_content { spec_file_prefix = $3; }
|
| "%file-prefix" "=" string_content { spec_file_prefix = $3; }
|
||||||
| "%glr-parser"
|
| "%glr-parser"
|
||||||
{
|
{
|
||||||
nondeterministic_parser = true;
|
nondeterministic_parser = true;
|
||||||
glr_parser = true;
|
glr_parser = true;
|
||||||
}
|
}
|
||||||
| "%initial-action {...}"
|
| "%initial-action {...}"
|
||||||
{
|
{
|
||||||
muscle_code_grow ("initial_action", $1, @1);
|
muscle_code_grow ("initial_action", $1, @1);
|
||||||
}
|
}
|
||||||
| "%lex-param {...}" { add_param ("lex_param", $1, @1); }
|
| "%lex-param {...}" { add_param ("lex_param", $1, @1); }
|
||||||
| "%locations" { locations_flag = true; }
|
| "%locations" { locations_flag = true; }
|
||||||
| "%name-prefix" "=" string_content { spec_name_prefix = $3; }
|
| "%name-prefix" "=" string_content { spec_name_prefix = $3; }
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ static bool
|
|||||||
symbol_typed_p (const symbol_list *s)
|
symbol_typed_p (const symbol_list *s)
|
||||||
{
|
{
|
||||||
return (s->sym->type_name
|
return (s->sym->type_name
|
||||||
|| s->midrule && s->midrule->used);
|
|| (s->midrule && s->midrule->used));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------.
|
/*----------------------------------------------------------------.
|
||||||
|
|||||||
@@ -155,7 +155,9 @@ yylex (LEX_PARAMETERS)
|
|||||||
static int colNum = 0;
|
static int colNum = 0;
|
||||||
|
|
||||||
#if YYPURE
|
#if YYPURE
|
||||||
|
# undef yylloc
|
||||||
# define yylloc (*llocp)
|
# define yylloc (*llocp)
|
||||||
|
# undef yylval
|
||||||
# define yylval (*lvalp)
|
# define yylval (*lvalp)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ AT_DATA_GRAMMAR([glr-regr3.y],
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
static int MergeRule (int x0, int x1);
|
static int MergeRule (int x0, int x1);
|
||||||
static void yyerror(char const * s);
|
static void yyerror (char const * s);
|
||||||
int yylex (void);
|
int yylex (void);
|
||||||
|
|
||||||
#define RULE(x) (1 << (x))
|
#define RULE(x) (1 << (x))
|
||||||
@@ -650,7 +650,7 @@ AT_DATA_GRAMMAR([glr-regr8.y],
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
static void yyerror (char const *);
|
static void yyerror (char const *);
|
||||||
static int yylex (void);
|
static int yylex (void);
|
||||||
static void yyerror(const char *msg);
|
static void yyerror (char const *msg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%token T_CONSTANT
|
%token T_CONSTANT
|
||||||
@@ -684,9 +684,10 @@ OptSignalWord : /* empty */
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
void yyerror(const char *msg)
|
void
|
||||||
|
yyerror (char const *msg)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "error\n");
|
fprintf (stderr, "%s\n", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lexIndex;
|
static int lexIndex;
|
||||||
@@ -856,9 +857,9 @@ yylex (void)
|
|||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
{
|
{
|
||||||
int index;
|
int i;
|
||||||
for (index = 0; index < GARBAGE_SIZE; index+=1)
|
for (i = 0; i < GARBAGE_SIZE; i+=1)
|
||||||
garbage[index] = 108;
|
garbage[i] = 108;
|
||||||
return yyparse ();
|
return yyparse ();
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
@@ -1087,11 +1088,11 @@ static int
|
|||||||
yylex (void)
|
yylex (void)
|
||||||
{
|
{
|
||||||
static char const *input = "ab";
|
static char const *input = "ab";
|
||||||
static int index = 0;
|
static int i = 0;
|
||||||
yylloc.first_line = yylloc.last_line = 1;
|
yylloc.first_line = yylloc.last_line = 1;
|
||||||
yylloc.first_column = yylloc.last_column = index+1;
|
yylloc.first_column = yylloc.last_column = i + 1;
|
||||||
yylval.value = input[index] + 'A' - 'a';
|
yylval.value = input[i] + 'A' - 'a';
|
||||||
return input[index++];
|
return input[i++];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1293,11 +1294,11 @@ static int
|
|||||||
yylex (void)
|
yylex (void)
|
||||||
{
|
{
|
||||||
static char const *input = "abcdddd";
|
static char const *input = "abcdddd";
|
||||||
static int index = 0;
|
static int i = 0;
|
||||||
yylloc.first_line = yylloc.last_line = 1;
|
yylloc.first_line = yylloc.last_line = 1;
|
||||||
yylloc.first_column = yylloc.last_column = index+1;
|
yylloc.first_column = yylloc.last_column = i + 1;
|
||||||
yylval.value = input[index] + 'A' - 'a';
|
yylval.value = input[i] + 'A' - 'a';
|
||||||
return input[index++];
|
return input[i++];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user