-
Notifications
You must be signed in to change notification settings - Fork 298
/
bison-2.6.5.patchset
100 lines (96 loc) · 3.46 KB
/
bison-2.6.5.patchset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
From 9a1dd934ea2f8fd0f05cb9bb0c647514810342c4 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 4 Aug 2014 19:41:40 +0000
Subject: c89 patch
diff --git a/src/AnnotationList.c b/src/AnnotationList.c
index 4c1e0ae..97f35f6 100644
--- a/src/AnnotationList.c
+++ b/src/AnnotationList.c
@@ -233,9 +233,10 @@ AnnotationList__computePredecessorAnnotations (AnnotationList *self, state *s,
AnnotationList *annotation_node =
AnnotationList__alloc_on_obstack (
self->inadequacyNode->contributionCount, annotations_obstackp);
- annotation_node->inadequacyNode = self->inadequacyNode;
bool potential_contribution = false;
bitset *lookaheads = NULL;
+ annotation_node->inadequacyNode = self->inadequacyNode;
+
{
ContributionIndex ci;
for (ci = 0; ci < self->inadequacyNode->contributionCount; ++ci)
diff --git a/src/getargs.c b/src/getargs.c
index 6490569..bbf1845 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -267,6 +267,7 @@ static void usage (int) ATTRIBUTE_NORETURN;
static void
usage (int status)
{
+ const char *lc_messages = setlocale (LC_MESSAGES, NULL);
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
@@ -370,7 +371,6 @@ THINGS 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 && strcmp (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 cde2baa..ce437e3 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/scan-code.l b/src/scan-code.l
index fa593be..54f2921 100644
--- a/src/scan-code.l
+++ b/src/scan-code.l
@@ -611,12 +611,12 @@ parse_ref (char *cp, symbol_list *rule, int rule_length,
indent += SUB_INDENT;
if (len == 0)
{
- location sym_loc = text_loc;
- sym_loc.start.column += 1;
- sym_loc.end = sym_loc.start;
const char *format =
_("syntax error after '%c', expecting integer, letter,"
" '_', '[', or '$'");
+ location sym_loc = text_loc;
+ sym_loc.start.column += 1;
+ sym_loc.end = sym_loc.start;
complain_at_indent (sym_loc, &indent, format, dollar_or_at);
}
else if (midrule_rhs_index)
diff --git a/src/uniqstr.c b/src/uniqstr.c
index 62d09ca..4d5f0a7 100644
--- a/src/uniqstr.c
+++ b/src/uniqstr.c
@@ -62,13 +62,14 @@ uniqstr_vsprintf (char const *format, ...)
va_start (args, 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. |
--
1.8.3.4