Files
haikuports/sys-devel/bison/patches/bison-3.0.4.patchset
2015-12-25 11:17:40 +00:00

197 lines
6.7 KiB
Plaintext

From 106cc98f0ecd239bc71eb44a908e9c7e0f63af67 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 24 Dec 2015 14:57:38 +0000
Subject: gcc2 fix
diff --git a/src/AnnotationList.c b/src/AnnotationList.c
index 586ed9b..375001a 100644
--- a/src/AnnotationList.c
+++ b/src/AnnotationList.c
@@ -230,12 +230,12 @@ AnnotationList__computePredecessorAnnotations (AnnotationList *self, state *s,
state **predecessor;
for (predecessor = predecessors[s->number]; *predecessor; ++predecessor)
{
+ bool potential_contribution = false;
+ bitset *lookaheads = NULL;
AnnotationList *annotation_node =
AnnotationList__alloc_on_obstack (
self->inadequacyNode->contributionCount, annotations_obstackp);
annotation_node->inadequacyNode = self->inadequacyNode;
- bool potential_contribution = false;
- bitset *lookaheads = NULL;
{
ContributionIndex ci;
for (ci = 0; ci < self->inadequacyNode->contributionCount; ++ci)
diff --git a/src/complain.c b/src/complain.c
index 22e18cb..4cc2361 100644
--- a/src/complain.c
+++ b/src/complain.c
@@ -104,6 +104,7 @@ ARGMATCH_VERIFY (warnings_args, warnings_types);
void
warning_argmatch (char const *arg, size_t no, size_t err)
{
+ size_t b;
int value = XARGMATCH ("--warning", arg + no + err,
warnings_args, warnings_types);
@@ -114,7 +115,6 @@ warning_argmatch (char const *arg, size_t no, size_t err)
no = !no;
}
- size_t b;
for (b = 0; b < warnings_size; ++b)
if (value & 1 << b)
{
diff --git a/src/getargs.c b/src/getargs.c
index fa9e3c1..433ff27 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -253,6 +253,7 @@ usage (int status)
program_name);
else
{
+ const char *lc_messages = setlocale (LC_MESSAGES, NULL);
/* For ../build-aux/cross-options.pl to work, use the format:
^ -S, --long[=ARGS] (whitespace)
A --long option is required.
@@ -363,7 +364,6 @@ FEATURE is a list of comma separated words that can include:\n\
/* Don't output this redundant message for English locales.
Note we still output for 'C' so that it gets included in the
man page. */
- const char *lc_messages = setlocale (LC_MESSAGES, NULL);
if (lc_messages && !STREQ (lc_messages, "en_"))
/* TRANSLATORS: Replace LANG_CODE in this URL with your language
code <http://translationproject.org/team/LANG_CODE.html> to
diff --git a/src/ielr.c b/src/ielr.c
index 8b28e67..29a2726 100644
--- a/src/ielr.c
+++ b/src/ielr.c
@@ -1032,9 +1032,9 @@ ielr_split_states (bitsetv follow_kernel_items, bitsetv always_follows,
lookahead sets. */
if (!annotation_lists)
{
+ state_list *node;
timevar_push (TV_IELR_PHASE4);
initialize_LA ();
- state_list *node;
for (node = first_state; node; node = node->next)
if (!node->state->consistent)
{
diff --git a/src/muscle-tab.c b/src/muscle-tab.c
index b38598b..4b285fb 100644
--- a/src/muscle-tab.c
+++ b/src/muscle-tab.c
@@ -468,12 +468,13 @@ muscle_percent_variable_update (char const *variable, location variable_loc,
&& STREQ (eq + 1, *value))
: STREQ (c->obsolete, variable))
{
+ char *res;
char *old = define_directive (c->obsolete, *value);
char *upd = define_directive (c->updated, *value);
deprecated_directive (&variable_loc, old, upd);
free (old);
free (upd);
- char *res = xstrdup (c->updated);
+ res = xstrdup (c->updated);
{
char *eq2 = strchr (res, '=');
if (eq2)
@@ -506,6 +507,7 @@ muscle_percent_define_insert (char const *var, location variable_loc,
if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
&& muscle_find_const (name))
{
+ location loc;
muscle_percent_define_how how_old = atoi (muscle_find_const (how_name));
unsigned i = 0;
if (how_old == MUSCLE_PERCENT_DEFINE_F)
@@ -514,7 +516,7 @@ muscle_percent_define_insert (char const *var, location variable_loc,
_("%%define variable %s redefined"),
quote (variable));
i += SUB_INDENT;
- location loc = muscle_percent_define_get_loc (variable);
+ loc = muscle_percent_define_get_loc (variable);
complain_indent (&loc, complaint, &i, _("previous definition"));
}
@@ -657,8 +659,9 @@ muscle_percent_define_flag_if (char const *variable)
result = false;
else if (!muscle_find_const (invalid_boolean_name))
{
+ location loc;
muscle_insert (invalid_boolean_name, "");
- location loc = muscle_percent_define_get_loc (variable);
+ loc = muscle_percent_define_get_loc (variable);
complain (&loc, complaint,
_("invalid value for %%define Boolean variable %s"),
quote (variable));
diff --git a/src/scan-gram.l b/src/scan-gram.l
index a7e9bc4..18b4426 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -952,10 +952,11 @@ handle_syncline (char *args, location loc)
static void
unexpected_end (boundary start, char const *msgid, char const *token_end)
{
+ size_t i;
location loc;
loc.start = start;
loc.end = scanner_cursor;
- size_t i = strlen (token_end);
+ i = strlen (token_end);
/* Adjust scanner cursor so that any later message does not count
the characters about to be inserted. */
diff --git a/src/symlist.c b/src/symlist.c
index 109c27c..18e6623 100644
--- a/src/symlist.c
+++ b/src/symlist.c
@@ -120,9 +120,9 @@ symbol_list_prepend (symbol_list *list, symbol_list *node)
symbol_list *
symbol_list_append (symbol_list *list, symbol_list *node)
{
+ symbol_list *next = list;
if (!list)
return node;
- symbol_list *next = list;
while (next->next)
next = next->next;
next->next = node;
diff --git a/src/symtab.c b/src/symtab.c
index fb025da..93f36b8 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -1030,8 +1030,9 @@ init_prec_nodes (void)
prec_nodes = xcalloc (nsyms, sizeof *prec_nodes);
for (i = 0; i < nsyms; ++i)
{
+ symgraph *s;
prec_nodes[i] = xmalloc (sizeof *prec_nodes[i]);
- symgraph *s = prec_nodes[i];
+ s = prec_nodes[i];
s->id = i;
s->succ = 0;
s->pred = 0;
diff --git a/src/uniqstr.c b/src/uniqstr.c
index a4e2db0..9a8e30b 100644
--- a/src/uniqstr.c
+++ b/src/uniqstr.c
@@ -63,12 +63,14 @@ uniqstr_vsprintf (char const *format, ...)
length = vsnprintf (NULL, 0, format, args);
va_end (args);
+{
char res[length + 1];
va_start (args, format);
vsprintf (res, format, args);
va_end (args);
return uniqstr_new (res);
}
+}
/*------------------------------.
| Abort if S is not a uniqstr. |
--
2.2.2