+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
# 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
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.])
[# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
# endif
switch (yytype)
{
#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 */
/** 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,
yybool* yynewLookaheadNeeds;
yynewStates = NULL;
-
+
if (yystackp->yytops.yycapacity
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
yyMemoryExhausted (yystackp);
b4_error_verbose_if([, int tok])[)
{
std::string res;
+ YYUSE (yystate);
#if YYERROR_VERBOSE
int yyn = yypact_[yystate];
if (yypact_ninf_ < yyn && yyn < yylast_)
#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 */
/* 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
#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. */
}
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)
{
}
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; }
| "%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; }
symbol_typed_p (const symbol_list *s)
{
return (s->sym->type_name
- || s->midrule && s->midrule->used);
+ || (s->midrule && s->midrule->used));
}
/*----------------------------------------------------------------.
static int colNum = 0;
#if YYPURE
+# undef yylloc
# define yylloc (*llocp)
+# undef yylval
# define yylval (*lvalp)
#endif
#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))
#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
%%
-void yyerror(const char *msg)
+void
+yyerror (char const *msg)
{
- fprintf (stderr, "error\n");
+ fprintf (stderr, "%s\n", msg);
}
static int lexIndex;
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 ();
}
]])
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
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