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:
Paul Eggert
2006-01-20 00:08:30 +00:00
parent ed94ef2ae4
commit c66dfaddf4
11 changed files with 79 additions and 32 deletions

View File

@@ -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>
* tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial

View File

@@ -1,6 +1,7 @@
# 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
# 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(-Wmissing-declarations)
BISON_WARNING(-Wmissing-prototypes)
BISON_WARNING(-Wnested-externs)
BISON_WARNING(-Wshadow)
BISON_WARNING(-Wstrict-prototypes)
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])

View File

@@ -472,6 +472,8 @@ b4_parse_param_use[]dnl
[# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
YYUSE (yyoutput);
# endif
switch (yytype)
{

View File

@@ -253,7 +253,7 @@ b4_syncline([@oline@], [@ofile@])
#endif
/* Suppress unused-variable warnings by "using" E. */
#ifndef lint
#if !defined (lint) || defined (__GNUC__)
# define YYUSE(e) ((void) (e))
#else
# 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
* 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. */
static void
yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
@@ -1536,7 +1536,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
yybool* yynewLookaheadNeeds;
yynewStates = NULL;
if (yystackp->yytops.yycapacity
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
yyMemoryExhausted (yystackp);

View File

@@ -829,6 +829,7 @@ b4_error_verbose_if([, yytoken])[));
b4_error_verbose_if([, int tok])[)
{
std::string res;
YYUSE (yystate);
#if YYERROR_VERBOSE
int yyn = yypact_[yystate];
if (yypact_ninf_ < yyn && yyn < yylast_)

View File

@@ -248,7 +248,7 @@ b4_syncline([@oline@], [@ofile@])[
#endif
/* Suppress unused-variable warnings by "using" E. */
#ifndef lint
#if !defined (lint) || defined (__GNUC__)
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */

View File

@@ -1,6 +1,6 @@
/* 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
it under the terms of the GNU General Public License as published by
@@ -71,6 +71,18 @@
#include "gettext.h"
#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. */
@@ -168,6 +180,7 @@ reap_subpipe (pid_t pid, char const *program)
}
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)
{
}

View File

@@ -206,7 +206,11 @@ declaration:
grammar_declaration
| PROLOGUE { prologue_augment ($1, @1); }
| "%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); }
| "%defines" { defines_flag = true; }
| "%error-verbose" { error_verbose = true; }
@@ -214,14 +218,14 @@ declaration:
| "%expect-rr" INT { expected_rr_conflicts = $2; }
| "%file-prefix" "=" string_content { spec_file_prefix = $3; }
| "%glr-parser"
{
nondeterministic_parser = true;
glr_parser = true;
}
{
nondeterministic_parser = true;
glr_parser = true;
}
| "%initial-action {...}"
{
muscle_code_grow ("initial_action", $1, @1);
}
{
muscle_code_grow ("initial_action", $1, @1);
}
| "%lex-param {...}" { add_param ("lex_param", $1, @1); }
| "%locations" { locations_flag = true; }
| "%name-prefix" "=" string_content { spec_name_prefix = $3; }

View File

@@ -221,7 +221,7 @@ static bool
symbol_typed_p (const symbol_list *s)
{
return (s->sym->type_name
|| s->midrule && s->midrule->used);
|| (s->midrule && s->midrule->used));
}
/*----------------------------------------------------------------.

View File

@@ -155,7 +155,9 @@ yylex (LEX_PARAMETERS)
static int colNum = 0;
#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

View File

@@ -240,7 +240,7 @@ AT_DATA_GRAMMAR([glr-regr3.y],
#include <stdarg.h>
static int MergeRule (int x0, int x1);
static void yyerror(char const * s);
static void yyerror (char const * s);
int yylex (void);
#define RULE(x) (1 << (x))
@@ -650,7 +650,7 @@ AT_DATA_GRAMMAR([glr-regr8.y],
#include <stdlib.h>
static void yyerror (char const *);
static int yylex (void);
static void yyerror(const char *msg);
static void yyerror (char const *msg);
%}
%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;
@@ -856,9 +857,9 @@ yylex (void)
int
main (void)
{
int index;
for (index = 0; index < GARBAGE_SIZE; index+=1)
garbage[index] = 108;
int i;
for (i = 0; i < GARBAGE_SIZE; i+=1)
garbage[i] = 108;
return yyparse ();
}
]])
@@ -1087,11 +1088,11 @@ static int
yylex (void)
{
static char const *input = "ab";
static int index = 0;
static int i = 0;
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = index+1;
yylval.value = input[index] + 'A' - 'a';
return input[index++];
yylloc.first_column = yylloc.last_column = i + 1;
yylval.value = input[i] + 'A' - 'a';
return input[i++];
}
static void
@@ -1293,11 +1294,11 @@ static int
yylex (void)
{
static char const *input = "abcdddd";
static int index = 0;
static int i = 0;
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = index+1;
yylval.value = input[index] + 'A' - 'a';
return input[index++];
yylloc.first_column = yylloc.last_column = i + 1;
yylval.value = input[i] + 'A' - 'a';
return input[i++];
}
static void