--- src/parse-gram.y	Sun Aug 26 08:33:20 2018
+++ src/parse-gram.y	Tue Sep 18 14:41:23 2018
@@ -376,7 +376,8 @@
       code_props_symbol_action_init (&code, $2, @2);
       code_props_translate_code (&code);
       {
-        for (symbol_list *list = $3; list; list = list->next)
+        symbol_list *list;
+        for (list = $3; list; list = list->next)
           symbol_list_code_props_set (list, $1, &code);
         symbol_list_free ($3);
       }
@@ -450,8 +451,9 @@
     }
 | "%type" TAG symbols.1
     {
+      symbol_list *list;
       tag_seen = true;
-      for (symbol_list *list = $3; list; list = list->next)
+      for (list = $3; list; list = list->next)
         symbol_type_set (list->content.sym, $2, @2);
       symbol_list_free ($3);
     }
@@ -460,8 +462,9 @@
 precedence_declaration:
   precedence_declarator tag.opt symbols.prec
     {
+      symbol_list *list;
       ++current_prec;
-      for (symbol_list *list = $3; list; list = list->next)
+      for (list = $3; list; list = list->next)
         {
           symbol_type_set (list->content.sym, current_type, @2);
           symbol_precedence_set (list->content.sym, current_prec, $1, @1);
@@ -726,6 +729,7 @@
 lloc_default (YYLTYPE const *rhs, int n)
 {
   YYLTYPE loc;
+  int i;
 
   /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
      The bug is fixed in 7.4.2m, but play it safe for now.  */
@@ -735,7 +739,7 @@
   /* Ignore empty nonterminals the start of the right-hand side.
      Do not bother to ignore them at the end of the right-hand side,
      since empty nonterminals have the same end as their predecessors.  */
-  for (int i = 1; i <= n; i++)
+  for (i = 1; i <= n; i++)
     if (! equal_boundaries (rhs[i].start, rhs[i].end))
       {
         loc.start = rhs[i].start;
--- src/symtab.c	Sat Aug 25 11:30:17 2018
+++ src/symtab.c	Tue Sep 18 14:57:20 2018
@@ -70,8 +70,11 @@
   res->symbol = s;
 
   res->type_name = NULL;
-  for (int i = 0; i < CODE_PROPS_SIZE; ++i)
+  {
+  int i;
+  for (i = 0; i < CODE_PROPS_SIZE; ++i)
     code_props_none_init (&res->props[i]);
+  }
 
   res->number = NUMBER_UNDEFINED;
   res->prec = 0;
@@ -201,8 +204,11 @@
   res->tag = tag;
   res->location = loc ? *loc : empty_location;
   res->status = undeclared;
-  for (int i = 0; i < CODE_PROPS_SIZE; ++i)
+  {
+  int i;
+  for (i = 0; i < CODE_PROPS_SIZE; ++i)
     code_props_none_init (&res->props[i]);
+  }
 
   return res;
 }
@@ -505,8 +511,11 @@
       s->number = nvars++;
     }
 
-  for (int i = 0; i < 2; ++i)
+  {
+  int i;
+  for (i = 0; i < 2; ++i)
     symbol_code_props_get (sym, i)->is_used = true;
+  }
 
   /* Set the semantic type status associated to the current symbol to
      'declared' so that we could check semantic types unnecessary uses. */
@@ -528,7 +537,8 @@
       || !*sem_type->tag
       || STREQ (sem_type->tag, "*"))
     {
-      for (int i = 0; i < 2; ++i)
+      int i;
+      for (i = 0; i < 2; ++i)
         if (sem_type->props[i].kind != CODE_PROPS_NONE
             && ! sem_type->props[i].is_used)
           complain (&sem_type->location, Wother,
@@ -576,11 +586,14 @@
     }
 
 
-  for (int i = 0; i < CODE_PROPS_SIZE; ++i)
+  {
+  int i;
+  for (i = 0; i < CODE_PROPS_SIZE; ++i)
     if (str->content->props[i].code)
       symbol_code_props_set (sym, i, &str->content->props[i]);
     else if (sym->content->props[i].code)
       symbol_code_props_set (str, i, &sym->content->props[i]);
+  }
 
   if (sym->content->prec || str->content->prec)
     {
@@ -774,9 +787,10 @@
 symbol_from_uniqstr (const uniqstr key, location loc)
 {
   symbol probe;
+  symbol *entry;
 
   probe.tag = key;
-  symbol *entry = hash_lookup (symbol_table, &probe);
+  entry = hash_lookup (symbol_table, &probe);
 
   if (!entry)
     {
@@ -799,9 +813,10 @@
 semantic_type_from_uniqstr (const uniqstr key, const location *loc)
 {
   semantic_type probe;
+  semantic_type *entry;
 
   probe.tag = key;
-  semantic_type *entry = hash_lookup (semantic_type_table, &probe);
+  entry = hash_lookup (semantic_type_table, &probe);
 
   if (!entry)
     {
@@ -849,9 +864,10 @@
   /* Incremented for each generated symbol.  */
   static int dummy_count = 0;
   static char buf[256];
+  symbol *sym;
 
   sprintf (buf, "$@%d", ++dummy_count);
-  symbol *sym = symbol_get (buf, loc);
+  sym = symbol_get (buf, loc);
   sym->content->class = nterm_sym;
   sym->content->number = nvars++;
   return sym;
@@ -900,13 +916,14 @@
             struct hash_table *table, symbol ***sorted)
 {
   size_t count = hash_get_n_entries (table);
+  size_t i;
   if (!*sorted)
     {
       *sorted = xnmalloc (count, sizeof **sorted);
       hash_get_entries (table, (void**)*sorted, count);
       qsort (*sorted, count, sizeof **sorted, symbols_cmp_qsort);
     }
-  for (size_t i = 0; i < count; ++i)
+  for (i = 0; i < count; ++i)
     processor ((*sorted)[i], processor_data);
 }
 
@@ -933,11 +950,12 @@
 symbols_token_translations_init (void)
 {
   bool num_256_available_p = true;
+  int i;
 
   /* Find the highest user token number, and whether 256, the POSIX
      preferred user token number for the error token, is used.  */
   max_user_token_number = 0;
-  for (int i = 0; i < ntokens; ++i)
+  for (i = 0; i < ntokens; ++i)
     {
       sym_content *this = symbols[i]->content;
       if (this->user_token_number != USER_NUMBER_UNDEFINED)
@@ -958,7 +976,7 @@
   if (max_user_token_number < 256)
     max_user_token_number = 256;
 
-  for (int i = 0; i < ntokens; ++i)
+  for (i = 0; i < ntokens; ++i)
     {
       sym_content *this = symbols[i]->content;
       if (this->user_token_number == USER_NUMBER_UNDEFINED)
@@ -972,7 +990,7 @@
 
   /* Initialize all entries for literal tokens to the internal token
      number for $undefined, which represents all invalid inputs.  */
-  for (int i = 0; i < max_user_token_number + 1; i++)
+  for (i = 0; i < max_user_token_number + 1; i++)
     token_translations[i] = undeftoken->content->number;
   symbols_do (symbol_translation_processor, NULL,
               symbol_table, &symbols_sorted);
@@ -993,7 +1011,8 @@
   /* Aliases leave empty slots in symbols, so remove them.  */
   {
     int nsyms_old = nsyms;
-    for (int writei = 0, readi = 0; readi < nsyms_old; readi += 1)
+    int writei, readi;
+    for (writei = 0, readi = 0; readi < nsyms_old; readi += 1)
       {
         if (symbols[readi] == NULL)
           {
@@ -1029,11 +1048,13 @@
 static void
 init_prec_nodes (void)
 {
+  int i;
   prec_nodes = xcalloc (nsyms, sizeof *prec_nodes);
-  for (int i = 0; i < nsyms; ++i)
+  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;
@@ -1121,7 +1142,8 @@
 static void
 assoc_free (void)
 {
-  for (int i = 0; i < nsyms; ++i)
+  int i;
+  for (i = 0; i < nsyms; ++i)
     {
       linkedlist_free (prec_nodes[i]->pred);
       linkedlist_free (prec_nodes[i]->succ);
@@ -1137,8 +1159,9 @@
 static void
 init_assoc (void)
 {
+  graphid i;
   used_assoc = xcalloc (nsyms, sizeof *used_assoc);
-  for (graphid i = 0; i < nsyms; ++i)
+  for (i = 0; i < nsyms; ++i)
     used_assoc[i] = false;
 }
 
@@ -1175,11 +1198,12 @@
 void
 print_precedence_warnings (void)
 {
+  int i;
   if (!prec_nodes)
     init_prec_nodes ();
   if (!used_assoc)
     init_assoc ();
-  for (int i = 0; i < nsyms; ++i)
+  for (i = 0; i < nsyms; ++i)
     {
       symbol *s = symbols[i];
       if (s
--- src/scan-code.c	Sat Aug 25 10:58:41 2018
+++ src/scan-code.c	Tue Sep 18 14:44:34 2018
@@ -2732,6 +2732,7 @@
           id_loc = var->loc;
         }
 
+      {
       const char *tail = explicit_bracketing ? "" : cp + strlen (var->id);
 
       /* Create the explanation message. */
@@ -2765,6 +2766,7 @@
       complain_indent (&id_loc, warning, &indent, "%s",
                         obstack_finish0 (&msg_buf));
       obstack_free (&msg_buf, 0);
+      }
     }
 }
 
--- src/AnnotationList.c	Sat Aug 25 10:55:03 2018
+++ src/AnnotationList.c	Tue Sep 18 13:18:26 2018
@@ -230,12 +230,12 @@
   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)
--- src/closure.c	Sat Aug 25 10:55:03 2018
+++ src/closure.c	Tue Sep 18 13:28:54 2018
@@ -54,11 +54,12 @@
 static void
 print_closure (char const *title, item_number const *array, size_t size)
 {
+  size_t i;
   fprintf (stderr, "Closure: %s\n", title);
-  for (size_t i = 0; i < size; ++i)
+  for (i = 0; i < size; ++i)
     {
-      fprintf (stderr, "  %2d: .", array[i]);
       item_number *rp;
+      fprintf (stderr, "  %2d: .", array[i]);
       for (rp = &ritem[array[i]]; *rp >= 0; ++rp)
         fprintf (stderr, " %s", symbols[*rp]->tag);
       fprintf (stderr, "  (rule %d)\n", -*rp - 1);
@@ -70,12 +71,13 @@
 static void
 print_firsts (void)
 {
+  symbol_number i;
   fprintf (stderr, "FIRSTS\n");
-  for (symbol_number i = ntokens; i < nsyms; ++i)
+  for (i = ntokens; i < nsyms; ++i)
     {
-      fprintf (stderr, "  %s firsts\n", symbols[i]->tag);
       bitset_iterator iter;
       symbol_number j;
+      fprintf (stderr, "  %s firsts\n", symbols[i]->tag);
       BITSET_FOR_EACH (iter, FIRSTS (i), j, 0)
         fprintf (stderr, "    %s\n", symbols[j + ntokens]->tag);
     }
@@ -86,12 +88,13 @@
 static void
 print_fderives (void)
 {
+  symbol_number i;
   fprintf (stderr, "FDERIVES\n");
-  for (symbol_number i = ntokens; i < nsyms; ++i)
+  for (i = ntokens; i < nsyms; ++i)
     {
-      fprintf (stderr, "  %s derives\n", symbols[i]->tag);
       bitset_iterator iter;
       rule_number r;
+      fprintf (stderr, "  %s derives\n", symbols[i]->tag);
       BITSET_FOR_EACH (iter, FDERIVES (i), r, 0)
         {
           fprintf (stderr, "    %3d ", r);
@@ -116,10 +119,11 @@
 static void
 set_firsts (void)
 {
+  symbol_number i, j;
   firsts = bitsetv_create (nvars, nvars, BITSET_FIXED);
 
-  for (symbol_number i = ntokens; i < nsyms; ++i)
-    for (symbol_number j = 0; derives[i - ntokens][j]; ++j)
+  for (i = ntokens; i < nsyms; ++i)
+    for (j = 0; derives[i - ntokens][j]; ++j)
       {
         item_number sym = derives[i - ntokens][j]->rhs[0];
         if (ISVAR (sym))
@@ -149,14 +153,16 @@
 static void
 set_fderives (void)
 {
+  symbol_number i, j;
+  rule_number k;
   fderives = bitsetv_create (nvars, nrules, BITSET_FIXED);
 
   set_firsts ();
 
-  for (symbol_number i = ntokens; i < nsyms; ++i)
-    for (symbol_number j = ntokens; j < nsyms; ++j)
+  for (i = ntokens; i < nsyms; ++i)
+    for (j = ntokens; j < nsyms; ++j)
       if (bitset_test (FIRSTS (i), j - ntokens))
-        for (rule_number k = 0; derives[j - ntokens][k]; ++k)
+        for (k = 0; derives[j - ntokens][k]; ++k)
           bitset_set (FDERIVES (i), derives[j - ntokens][k]->number);
 
   if (trace_flag & trace_sets)
@@ -182,23 +188,25 @@
 void
 closure (item_number const *core, size_t n)
 {
+  size_t c;
   if (trace_flag & trace_sets)
     print_closure ("input", core, n);
 
   bitset_zero (ruleset);
 
-  for (size_t c = 0; c < n; ++c)
+  for (c = 0; c < n; ++c)
     if (ISVAR (ritem[core[c]]))
       bitset_or (ruleset, ruleset, FDERIVES (ritem[core[c]]));
 
   /* core is sorted on item index in ritem, which is sorted on rule number.
      Compute itemset with the same sort.  */
   /* A bit index over RULESET. */
+  {
   rule_number ruleno;
   bitset_iterator iter;
 
   nitemset = 0;
-  size_t c = 0;
+  c = 0;
   BITSET_FOR_EACH (iter, ruleset, ruleno, 0)
     {
       item_number itemno = rules[ruleno].rhs - ritem;
@@ -211,6 +219,7 @@
       itemset[nitemset] = itemno;
       nitemset++;
     };
+  }
 
   while (c < n)
     {
--- src/complain.c	Sat Aug 25 10:55:03 2018
+++ src/complain.c	Tue Sep 18 13:35:03 2018
@@ -104,6 +104,7 @@
 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 @@
       no = !no;
     }
 
-  size_t b;
   for (b = 0; b < warnings_size; ++b)
     if (value & 1 << b)
       {
--- src/conflicts.c	Sat Aug 25 10:55:03 2018
+++ src/conflicts.c	Tue Sep 18 13:51:31 2018
@@ -220,10 +220,11 @@
 static void
 flush_shift (state *s, int token)
 {
+  int i;
   transitions *trans = s->transitions;
 
   bitset_reset (lookahead_set, token);
-  for (int i = 0; i < trans->num; ++i)
+  for (i = 0; i < trans->num; ++i)
     if (!TRANSITION_IS_DISABLED (trans, i)
         && TRANSITION_SYMBOL (trans, i) == token)
       TRANSITION_DISABLE (trans, i);
@@ -264,7 +265,8 @@
   int redprec = redrule->prec->prec;
   bitset lookahead_tokens = reds->lookahead_tokens[ruleno];
 
-  for (symbol_number i = 0; i < ntokens; ++i)
+  symbol_number i;
+  for (i = 0; i < ntokens; ++i)
     if (bitset_test (lookahead_tokens, i)
         && bitset_test (lookahead_set, i)
         && symbols[i]->content->prec)
@@ -335,12 +337,12 @@
 static void
 set_conflicts (state *s, symbol **errors)
 {
-  if (s->consistent)
-    return;
-
   reductions *reds = s->reductions;
   int nerrs = 0;
 
+  if (s->consistent)
+    return;
+
   bitset_zero (lookahead_set);
 
   {
@@ -353,10 +355,14 @@
   /* Loop over all rules which require lookahead in this state.  First
      check for shift-reduce conflict, and try to resolve using
      precedence.  */
-  for (int i = 0; i < reds->num; ++i)
+   
+  {
+  int i;
+  for (i = 0; i < reds->num; ++i)
     if (reds->rules[i]->prec && reds->rules[i]->prec->prec
         && !bitset_disjoint_p (reds->lookahead_tokens[i], lookahead_set))
       resolve_sr_conflict (s, i, errors, &nerrs);
+  }
 
   if (nerrs)
     /* Some tokens have been explicitly made errors.  Allocate a
@@ -370,12 +376,15 @@
 
   /* Loop over all rules which require lookahead in this state.  Check
      for conflicts not resolved above.  */
-  for (int i = 0; i < reds->num; ++i)
+  {
+  int i;
+  for (i = 0; i < reds->num; ++i)
     {
       if (!bitset_disjoint_p (reds->lookahead_tokens[i], lookahead_set))
         conflicts[s->number] = 1;
       bitset_or (lookahead_set, lookahead_set, reds->lookahead_tokens[i]);
     }
+  }
 }
 
 
@@ -387,6 +396,8 @@
 void
 conflicts_solve (void)
 {
+  state_number i;
+
   /* List of lookahead tokens on which we explicitly raise a syntax error.  */
   symbol **errors = xnmalloc (ntokens + 1, sizeof *errors);
 
@@ -396,7 +407,7 @@
   obstack_init (&solved_conflicts_obstack);
   obstack_init (&solved_conflicts_xml_obstack);
 
-  for (state_number i = 0; i < nstates; ++i)
+  for (i = 0; i < nstates; ++i)
     {
       set_conflicts (states[i], errors);
 
@@ -414,7 +425,8 @@
 conflicts_update_state_numbers (state_number old_to_new[],
                                 state_number nstates_old)
 {
-  for (state_number i = 0; i < nstates_old; ++i)
+  state_number i;
+  for (i = 0; i < nstates_old; ++i)
     if (old_to_new[i] != nstates_old)
       conflicts[old_to_new[i]] = conflicts[i];
 }
@@ -440,10 +452,11 @@
     int i;
     FOR_EACH_SHIFT (trans, i)
       bitset_set (shift_set, TRANSITION_SYMBOL (trans, i));
+
+    for (i = 0; i < reds->num; ++i)
+      bitset_or (lookahead_set, lookahead_set, reds->lookahead_tokens[i]);
   }
 
-  for (int i = 0; i < reds->num; ++i)
-    bitset_or (lookahead_set, lookahead_set, reds->lookahead_tokens[i]);
 
   bitset_and (lookahead_set, lookahead_set, shift_set);
 
@@ -458,8 +471,9 @@
 count_sr_conflicts (void)
 {
   size_t res = 0;
+  state_number i;
   /* Conflicts by state.  */
-  for (state_number i = 0; i < nstates; ++i)
+  for (i = 0; i < nstates; ++i)
     if (conflicts[i])
       res += count_state_sr_conflicts (states[i]);
   return res;
@@ -479,11 +493,13 @@
 {
   reductions *reds = s->reductions;
   size_t res = 0;
+  symbol_number i;
 
-  for (symbol_number i = 0; i < ntokens; ++i)
+  for (i = 0; i < ntokens; ++i)
     {
       int count = 0;
-      for (int j = 0; j < reds->num; ++j)
+      int j;
+      for (j = 0; j < reds->num; ++j)
         count += bitset_test (reds->lookahead_tokens[j], i);
       if (count >= 2)
         res += one_per_token ? 1 : count-1;
@@ -496,8 +512,9 @@
 count_rr_conflicts (bool one_per_token)
 {
   size_t res = 0;
+  state_number i;
   /* Conflicts by state.  */
-  for (state_number i = 0; i < nstates; ++i)
+  for (i = 0; i < nstates; ++i)
     if (conflicts[i])
       res += count_state_rr_conflicts (states[i], one_per_token);
   return res;
@@ -512,7 +529,8 @@
 conflicts_output (FILE *out)
 {
   bool printed_sth = false;
-  for (state_number i = 0; i < nstates; ++i)
+  state_number i;
+  for (i = 0; i < nstates; ++i)
     {
       state *s = states[i];
       if (conflicts[i])
--- src/getargs.c	Sat Aug 25 10:55:03 2018
+++ src/getargs.c	Tue Sep 18 13:49:23 2018
@@ -360,6 +360,8 @@
       fputs (_("General help using GNU software: "
                "<http://www.gnu.org/gethelp/>.\n"),
              stdout);
+#ifdef LC_MESSAGES
+      {
       /* Don't output this redundant message for English locales.
          Note we still output for 'C' so that it gets included in the
          man page.  */
@@ -372,6 +374,8 @@
            email address.  */
         fputs (_("Report translation bugs to "
                  "<http://translationproject.org/team/>.\n"), stdout);
+      }
+#endif
       fputs (_("For complete documentation, run: info bison.\n"), stdout);
     }
 
--- src/ielr.c	Sat Aug 25 10:55:03 2018
+++ src/ielr.c	Tue Sep 18 14:22:04 2018
@@ -101,13 +101,15 @@
   *edge_countsp = xnmalloc (ngotos, sizeof **edge_countsp);
   {
     bitset sources = bitset_create (ngotos, BITSET_FIXED);
-    for (goto_number i = 0; i < ngotos; ++i)
+    goto_number i;
+    for (i = 0; i < ngotos; ++i)
       (*edge_countsp)[i] = 0;
-    for (goto_number i = 0; i < ngotos; ++i)
+    for (i = 0; i < ngotos; ++i)
       {
         int nsources = 0;
         {
-          for (rule **rulep = derives[states[to_state[i]]->accessing_symbol
+          rule **rulep;
+          for (rulep = derives[states[to_state[i]]->accessing_symbol
                                       - ntokens];
                *rulep;
                ++rulep)
@@ -196,12 +198,15 @@
 {
   {
     size_t max_nitems = 0;
-    for (state_number i = 0; i < nstates; ++i)
+    state_number i;
+    for (i = 0; i < nstates; ++i)
       if (states[i]->nitems > max_nitems)
         max_nitems = states[i]->nitems;
     *follow_kernel_itemsp = bitsetv_create (ngotos, max_nitems, BITSET_FIXED);
   }
-  for (goto_number i = 0; i < ngotos; ++i)
+  {
+  goto_number i;
+  for (i = 0; i < ngotos; ++i)
     {
       size_t nitems = states[from_state[i]]->nitems;
       item_number *items = states[from_state[i]]->items;
@@ -216,6 +221,7 @@
             && bitset_test (ritem_sees_lookahead_set, items[j]))
           bitset_set ((*follow_kernel_itemsp)[i], j);
     }
+  }
   relation_digraph (internal_follow_edges, ngotos, follow_kernel_itemsp);
 
   if (trace_flag & trace_ielr)
@@ -245,8 +251,9 @@
 {
   *always_followsp = bitsetv_create (ngotos, ntokens, BITSET_FIXED);
   {
+    goto_number i;
     goto_number *edge_array = xnmalloc (ngotos, sizeof *edge_array);
-    for (goto_number i = 0; i < ngotos; ++i)
+    for (i = 0; i < ngotos; ++i)
       {
         goto_number nedges = edge_counts[i];
         {
@@ -295,26 +302,29 @@
 {
   int *predecessor_counts = xnmalloc (nstates, sizeof *predecessor_counts);
   state ***result = xnmalloc (nstates, sizeof *result);
-  for (state_number i = 0; i < nstates; ++i)
+  state_number i;
+  for (i = 0; i < nstates; ++i)
     predecessor_counts[i] = 0;
-  for (state_number i = 0; i < nstates; ++i)
+  for (i = 0; i < nstates; ++i)
     {
       int j;
       for (j = 0; j < states[i]->transitions->num; ++j)
         ++predecessor_counts[states[i]->transitions->states[j]->number];
     }
-  for (state_number i = 0; i < nstates; ++i)
+  for (i = 0; i < nstates; ++i)
     {
       result[i] = xnmalloc (predecessor_counts[i]+1, sizeof *result[i]);
       result[i][predecessor_counts[i]] = NULL;
       predecessor_counts[i] = 0;
     }
-  for (state_number i = 0; i < nstates; ++i)
-    for (int j = 0; j < states[i]->transitions->num; ++j)
+  for (i = 0; i < nstates; ++i) {
+    int j;
+    for (j = 0; j < states[i]->transitions->num; ++j)
       {
         state_number k = states[i]->transitions->states[j]->number;
         result[k][predecessor_counts[k]++] = states[i];
       }
+    }
   free (predecessor_counts);
   return result;
 }
@@ -343,8 +353,11 @@
     bitset_free (ritem_sees_lookahead_set);
   }
   ielr_compute_always_follows (&edges, edge_counts, always_followsp);
-  for (int i = 0; i < ngotos; ++i)
+  {
+  int i;
+  for (i = 0; i < ngotos; ++i)
     free (edges[i]);
+  }
   free (edges);
   free (edge_counts);
   if (predecessorsp)
@@ -369,8 +382,11 @@
     {
       item_lookahead_sets[s->number] =
         xnmalloc (s->nitems, sizeof item_lookahead_sets[s->number][0]);
-      for (size_t i = 0; i < s->nitems; ++i)
+      {
+      size_t i;
+      for (i = 0; i < s->nitems; ++i)
         item_lookahead_sets[s->number][i] = NULL;
+      }
     }
   if (!item_lookahead_sets[s->number][item])
     {
@@ -408,8 +424,9 @@
              check all predecessors' goto follows for the LHS.  */
           if (item_number_is_rule_number (ritem[s->items[item] - 2]))
             {
+              state **predecessor;
               aver (lhs != accept->content->number);
-              for (state **predecessor = predecessors[s->number];
+              for (predecessor = predecessors[s->number];
                    *predecessor;
                    ++predecessor)
                 bitset_or (item_lookahead_sets[s->number][item],
@@ -421,7 +438,8 @@
              predecessor items' lookahead sets.  */
           else
             {
-              for (state **predecessor = predecessors[s->number];
+              state **predecessor;
+              for (predecessor = predecessors[s->number];
                    *predecessor;
                    ++predecessor)
                 {
@@ -476,10 +494,11 @@
     xnmalloc (nstates, sizeof *annotation_counts);
   ContributionIndex max_contributions = 0;
   unsigned total_annotations = 0;
+  state_number i;
 
   *inadequacy_listsp = xnmalloc (nstates, sizeof **inadequacy_listsp);
   *annotation_listsp = xnmalloc (nstates, sizeof **annotation_listsp);
-  for (state_number i = 0; i < nstates; ++i)
+  for (i = 0; i < nstates; ++i)
     {
       item_lookahead_sets[i] = NULL;
       (*inadequacy_listsp)[i] = NULL;
@@ -488,7 +507,7 @@
     }
   {
     InadequacyListNodeCount inadequacy_list_node_count = 0;
-    for (state_number i = 0; i < nstates; ++i)
+    for (i = 0; i < nstates; ++i)
       AnnotationList__compute_from_inadequacies (
         states[i], follow_kernel_items, always_follows, predecessors,
         item_lookahead_sets, *inadequacy_listsp, *annotation_listsp,
@@ -496,7 +515,7 @@
         &inadequacy_list_node_count);
   }
   *max_annotationsp = 0;
-  for (state_number i = 0; i < nstates; ++i)
+  for (i = 0; i < nstates; ++i)
     {
       if (annotation_counts[i] > *max_annotationsp)
         *max_annotationsp = annotation_counts[i];
@@ -504,7 +523,7 @@
     }
   if (trace_flag & trace_ielr)
     {
-      for (state_number i = 0; i < nstates; ++i)
+      for (i = 0; i < nstates; ++i)
         {
           fprintf (stderr, "Inadequacy annotations for state %d:\n", i);
           AnnotationList__debug ((*annotation_listsp)[i],
@@ -518,14 +537,17 @@
       fprintf (stderr, "Max number of contributions per annotation: %d\n",
                max_contributions);
     }
-  for (state_number i = 0; i < nstates; ++i)
+  {
+  for (i = 0; i < nstates; ++i)
     if (item_lookahead_sets[i])
       {
-        for (size_t j = 0; j < states[i]->nitems; ++j)
+        size_t j;
+        for (j = 0; j < states[i]->nitems; ++j)
           if (item_lookahead_sets[i][j])
             bitset_free (item_lookahead_sets[i][j]);
         free (item_lookahead_sets[i]);
       }
+  }
   free (item_lookahead_sets);
   free (annotation_counts);
 }
@@ -596,8 +618,9 @@
                          bitsetv lookaheads)
 {
   size_t s_item = 0;
+  size_t t_item;
   bitsetv_zero (lookaheads);
-  for (size_t t_item = 0; t_item < t->nitems; ++t_item)
+  for (t_item = 0; t_item < t->nitems; ++t_item)
     {
       /* If this kernel item is the beginning of a RHS, it must be the
          kernel item in the start state, but t is supposed to be a successor
@@ -750,13 +773,16 @@
       }
   }
 
+  {
+  size_t i;
   has_lookaheads = false;
-  for (size_t i = 0; i < lr0_isocore->state->nitems; ++i)
+  for (i = 0; i < lr0_isocore->state->nitems; ++i)
     if (!bitset_empty_p (lookaheads[i]))
       {
         has_lookaheads = true;
         break;
       }
+  }
 
   /* Merge with an existing isocore.  */
   if (this_isocorep == &t->state_list || *this_isocorep != t->state_list)
@@ -801,8 +827,9 @@
         {
           /* When merging demands identical lookahead sets, it is impossible to
              merge new lookaheads.  */
+          int i;
           aver (annotation_lists);
-          for (int i = 0; i < (*tp)->transitions->num; ++i)
+          for (i = 0; i < (*tp)->transitions->num; ++i)
             {
               state *t2 = (*tp)->transitions->states[i];
               /* At any time, there's at most one state for which we have so
@@ -946,7 +973,8 @@
   {
     size_t max_nitems = 0;
     state_list **nodep = &first_state;
-    for (state_number i = 0; i < nstates; ++i)
+    state_number i;
+    for (i = 0; i < nstates; ++i)
       {
         *nodep = states[i]->state_list = last_state = xmalloc (sizeof **nodep);
         (*nodep)->state = states[i];
@@ -968,12 +996,14 @@
   /* Recompute states.  */
   {
     ContributionIndex *work = xnmalloc (max_annotations, sizeof *work);
-    for (state_list *this_state = first_state;
+    state_list *this_state;
+    for (this_state = first_state;
          this_state;
          this_state = this_state->next)
       {
         state *s = this_state->state;
-        for (int i = 0; i < s->transitions->num; ++i)
+        int i;
+        for (i = 0; i < s->transitions->num; ++i)
           {
             state *t = s->transitions->states[i];
             if (annotation_lists)
@@ -995,23 +1025,28 @@
   bitsetv_free (lookahead_filter);
   bitsetv_free (lookaheads);
 
+  {
   /* Store states back in the states array.  */
+  state_list *node;
   states = xnrealloc (states, nstates, sizeof *states);
-  for (state_list *node = first_state; node; node = node->next)
+  for (node = first_state; node; node = node->next)
     states[node->state->number] = node->state;
+  }
 
   /* In the case of canonical LR(1), copy item lookahead sets to reduction
      lookahead sets.  */
   if (!annotation_lists)
     {
+      state_list *node;
       timevar_push (TV_IELR_PHASE4);
       initialize_LA ();
-      for (state_list *node = first_state; node; node = node->next)
+      for (node = first_state; node; node = node->next)
         if (!node->state->consistent)
           {
             size_t i = 0;
             item_number *itemset = node->state->items;
-            for (size_t r = 0; r < node->state->reductions->num; ++r)
+            size_t r;
+            for (r = 0; r < node->state->reductions->num; ++r)
               {
                 rule *this_rule = node->state->reductions->rules[r];
                 bitset lookahead_set =
@@ -1119,8 +1154,11 @@
                                          predecessors, &max_annotations,
                                          &inadequacy_lists, &annotation_lists,
                                          &annotations_obstack);
-          for (state_number i = 0; i < nstates; ++i)
-            free (predecessors[i]);
+          {
+            state_number i;
+            for (i = 0; i < nstates; ++i)
+              free (predecessors[i]);
+          }
           free (predecessors);
           bitsetv_free (goto_follows);
           lalr_free ();
@@ -1134,9 +1172,11 @@
       state_number nstates_lr0 = nstates;
       ielr_split_states (follow_kernel_items, always_follows,
                          annotation_lists, max_annotations);
-      if (inadequacy_lists)
-        for (state_number i = 0; i < nstates_lr0; ++i)
+      if (inadequacy_lists) {
+        state_number i;
+        for (i = 0; i < nstates_lr0; ++i)
           InadequacyList__delete (inadequacy_lists[i]);
+      }
     }
     free (inadequacy_lists);
     if (annotation_lists)
--- src/muscle-tab.c	Sat Aug 25 10:55:03 2018
+++ src/muscle-tab.c	Tue Sep 18 14:14:28 2018
@@ -468,12 +468,13 @@
              && 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)
@@ -514,8 +515,10 @@
                        _("%%define variable %s redefined"),
                        quote (variable));
       i += SUB_INDENT;
+      {
       location loc = muscle_percent_define_get_loc (variable);
       complain_indent (&loc, complaint, &i, _("previous definition"));
+      }
     }
 
   MUSCLE_INSERT_STRING (name, value);
@@ -657,8 +660,9 @@
         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));
--- src/output.c	Sat Aug 25 10:55:03 2018
+++ src/output.c	Tue Sep 18 14:31:13 2018
@@ -67,7 +67,9 @@
   int j = 1;                                                            \
                                                                         \
   obstack_printf (&format_obstack, "%6d", first);                       \
-  for (int i = begin; i < end; ++i)                                     \
+  {                                                                     \
+  int i;                                                                \
+  for (i = begin; i < end; ++i)                                         \
     {                                                                   \
       obstack_1grow (&format_obstack, ',');                             \
       if (j >= 10)                                                      \
@@ -83,15 +85,17 @@
       if (max < table_data[i])                                          \
         max = table_data[i];                                            \
     }                                                                   \
+  }                                                                     \
   muscle_insert (name, obstack_finish0 (&format_obstack));              \
-                                                                        \
-  long lmin = min;                                                      \
-  long lmax = max;                                                      \
-  /* Build 'NAME_min' and 'NAME_max' in the obstack. */                 \
-  obstack_printf (&format_obstack, "%s_min", name);                     \
-  MUSCLE_INSERT_LONG_INT (obstack_finish0 (&format_obstack), lmin);     \
-  obstack_printf (&format_obstack, "%s_max", name);                     \
-  MUSCLE_INSERT_LONG_INT (obstack_finish0 (&format_obstack), lmax);     \
+  {                                                                     \
+    long lmin = min;                                                    \
+    long lmax = max;                                                    \
+    /* Build 'NAME_min' and 'NAME_max' in the obstack. */               \
+    obstack_printf (&format_obstack, "%s_min", name);                   \
+    MUSCLE_INSERT_LONG_INT (obstack_finish0 (&format_obstack), lmin);   \
+    obstack_printf (&format_obstack, "%s_max", name);                   \
+    MUSCLE_INSERT_LONG_INT (obstack_finish0 (&format_obstack), lmax);   \
+  }                                                                     \
 }
 
 GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_unsigned_int_table, unsigned)
@@ -158,10 +162,11 @@
   {
     /* We assume that the table will be output starting at column 2. */
     int j = 2;
+    int i;
     struct quoting_options *qo = clone_quoting_options (0);
     set_quoting_style (qo, c_quoting_style);
     set_quoting_flags (qo, QA_SPLIT_TRIGRAPHS);
-    for (int i = 0; i < nsyms; i++)
+    for (i = 0; i < nsyms; i++)
       {
         char *cp = quotearg_alloc (symbols[i]->tag, -1, qo);
         /* Width of the next token, including the two quotes, the
@@ -191,7 +196,8 @@
   /* Output YYTOKNUM. */
   {
     int *values = xnmalloc (ntokens, sizeof *values);
-    for (int i = 0; i < ntokens; ++i)
+    int i;
+    for (i = 0; i < ntokens; ++i)
       values[i] = symbols[i]->content->user_token_number;
     muscle_insert_int_table ("toknum", values,
                              values[0], 1, ntokens);
@@ -214,8 +220,9 @@
   int *dprec = xnmalloc (nrules, sizeof *dprec);
   int *merger = xnmalloc (nrules, sizeof *merger);
   int *immediate = xnmalloc (nrules, sizeof *immediate);
+  rule_number r;
 
-  for (rule_number r = 0; r < nrules; ++r)
+  for (r = 0; r < nrules; ++r)
     {
       /* LHS of the rule R. */
       r1[r] = rules[r].lhs->number;
@@ -257,7 +264,8 @@
 prepare_states (void)
 {
   symbol_number *values = xnmalloc (nstates, sizeof *values);
-  for (state_number i = 0; i < nstates; ++i)
+  state_number i;
+  for (i = 0; i < nstates; ++i)
     values[i] = states[i]->accessing_symbol;
   muscle_insert_symbol_number_table ("stos", values,
                                      0, 1, nstates);
@@ -306,8 +314,9 @@
 type_names_output (FILE *out)
 {
   symbol **syms = symbols_by_type_name ();
+  int i;
   fputs ("m4_define([b4_type_names],\n[", out);
-  for (int i = 0; i < nsyms; /* nothing */)
+  for (i = 0; i < nsyms; /* nothing */)
     {
       /* The index of the first symbol of the current type-name.  */
       int i0 = i;
@@ -329,8 +338,9 @@
 static void
 symbol_numbers_output (FILE *out)
 {
+  int i;
   fputs ("m4_define([b4_symbol_numbers],\n[", out);
-  for (int i = 0; i < nsyms; ++i)
+  for (i = 0; i < nsyms; ++i)
     fprintf (out, "%s[%d]", i ? ", " : "", i);
   fputs ("])\n\n", out);
 }
@@ -343,8 +353,9 @@
 static void
 user_actions_output (FILE *out)
 {
+  rule_number r;
   fputs ("m4_define([b4_actions], \n[", out);
-  for (rule_number r = 0; r < nrules; ++r)
+  for (r = 0; r < nrules; ++r)
     if (rules[r].action)
       {
         fprintf (out, "%s(%d, [b4_syncline(%d, ",
@@ -363,9 +374,9 @@
 static void
 merger_output (FILE *out)
 {
-  fputs ("m4_define([b4_mergers], \n[[", out);
   int n;
   merger_list* p;
+  fputs ("m4_define([b4_mergers], \n[[", out);
   for (n = 1, p = merge_functions; p != NULL; n += 1, p = p->next)
     {
       if (p->type[0] == '\0')
@@ -386,7 +397,8 @@
 static void
 prepare_symbol_definitions (void)
 {
-  for (int i = 0; i < nsyms; ++i)
+  int i;
+  for (i = 0; i < nsyms; ++i)
     {
       symbol *sym = symbols[i];
       const char *key;
@@ -431,7 +443,9 @@
       MUSCLE_INSERT_STRING (key, sym->content->type_name
                             ? sym->content->type_name : "");
 
-      for (int j = 0; j < CODE_PROPS_SIZE; ++j)
+      {
+      int j;
+      for (j = 0; j < CODE_PROPS_SIZE; ++j)
         {
           /* "printer", not "%printer".  */
           char const *pname = code_props_type_string (j) + 1;
@@ -451,6 +465,7 @@
               MUSCLE_INSERT_STRING_RAW (key, p->code);
             }
         }
+      }
 #undef SET_KEY2
 #undef SET_KEY
     }
@@ -536,6 +551,8 @@
   char *skel = (IS_PATH_WITH_DIR (skeleton)
                 ? xstrdup (skeleton)
                 : xconcatenated_filename (datadir, skeleton, NULL));
+  int filter_fd[2];
+  pid_t pid;
 
   /* Test whether m4sugar.m4 is readable, to check for proper
      installation.  A faulty installation can cause deadlock, so a
@@ -555,8 +572,6 @@
      See the thread starting at
      <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>
      for details.  */
-  int filter_fd[2];
-  pid_t pid;
   {
     char const *argv[10];
     int i = 0;
--- src/reader.c	Sat Aug 25 10:55:03 2018
+++ src/reader.c	Tue Sep 18 14:33:30 2018
@@ -81,6 +81,7 @@
   if (! glr_parser)
     return 0;
 
+  {
   merger_list *syms;
   merger_list head;
   int n;
@@ -100,6 +101,7 @@
       merge_functions = head.next;
     }
   return n;
+  }
 }
 
 /*-------------------------------------------------------------------------.
@@ -114,6 +116,7 @@
   if (merger <= 0)
     return;
 
+  {
   int merger_find;
   merger_list *merge_function;
 
@@ -141,6 +144,7 @@
     }
   merge_function->type = uniqstr_new (type);
   merge_function->type_declaration_location = declaration_loc;
+  }
 }
 
 /*--------------------------------------.
@@ -231,9 +235,11 @@
   ++nrules;
   previous_rule_end = grammar_end;
 
-  symbol_list *p = grammar_symbol_append (lhs, loc);
-  if (lhs_name)
-    assign_named_ref (p, named_ref_copy (lhs_name));
+  {
+    symbol_list *p = grammar_symbol_append (lhs, loc);
+    if (lhs_name)
+      assign_named_ref (p, named_ref_copy (lhs_name));
+  }
 
   current_rule = grammar_end;
 
@@ -313,7 +319,8 @@
   /* Check that symbol values that should be used are in fact used.  */
   {
     int n = 0;
-    for (symbol_list const *l = r; l && l->content.sym; l = l->next, ++n)
+    symbol_list const *l;
+    for (l = r; l && l->content.sym; l = l->next, ++n)
       {
         bool midrule_warning = false;
         if (!l->action_props.is_value_used
@@ -385,17 +392,18 @@
   /* Since the action was written out with this rule's number, we must
      give the new rule this number by inserting the new rule before
      it.  */
-
+  symbol_list *midrule;
+  named_ref *action_name;
   /* Make a DUMMY nonterminal, whose location is that of the midrule
      action.  Create the MIDRULE.  */
   location dummy_location = current_rule->action_props.location;
   symbol *dummy = dummy_symbol_get (dummy_location);
   symbol_type_set(dummy,
                   current_rule->action_props.type, current_rule->action_props.location);
-  symbol_list *midrule = symbol_list_sym_new (dummy, dummy_location);
+  midrule = symbol_list_sym_new (dummy, dummy_location);
 
   /* Remember named_ref of previous action. */
-  named_ref *action_name = current_rule->action_props.named_ref;
+  action_name = current_rule->action_props.named_ref;
 
   /* Make a new rule, whose body is empty, before the current one, so
      that the action just read can belong to it.  */
@@ -518,9 +526,10 @@
 grammar_current_rule_symbol_append (symbol *sym, location loc,
                                     named_ref *name)
 {
+  symbol_list *p;
   if (current_rule->action_props.code)
     grammar_midrule_action ();
-  symbol_list *p = grammar_symbol_append (sym, loc);
+  p = grammar_symbol_append (sym, loc);
   if (name)
     assign_named_ref (p, name);
   if (sym->content->status == undeclared || sym->content->status == used)
@@ -566,6 +575,7 @@
 {
   unsigned itemno = 0;
   rule_number ruleno = 0;
+  symbol_list *p;
 
   ritem = xnmalloc (nritems + 1, sizeof *ritem);
 
@@ -574,7 +584,7 @@
 
   rules = xnmalloc (nrules, sizeof *rules);
 
-  for (symbol_list *p = grammar; p; p = p->next)
+  for (p = grammar; p; p = p->next)
     {
       symbol *ruleprec = p->ruleprec;
       record_merge_function_type (p->merger, p->content.sym->content->type_name,
@@ -804,8 +814,11 @@
      rule.  For the same reason, all the 'used' flags must be set before
      checking whether to remove '$' from any midrule symbol name (also in
      packgram).  */
-  for (symbol_list *sym = grammar; sym; sym = sym->next)
+  {
+  symbol_list *sym;
+  for (sym = grammar; sym; sym = sym->next)
     code_props_translate_code (&sym->action_props);
+  }
 
   /* Convert the grammar into the format described in gram.h.  */
   packgram ();
--- src/scan-code.l	Sat Aug 25 10:55:03 2018
+++ src/scan-code.l	Tue Sep 18 15:06:38 2018
@@ -352,6 +352,7 @@
           id_loc = var->loc;
         }
 
+      {
       const char *tail = explicit_bracketing ? "" : cp + strlen (var->id);
 
       /* Create the explanation message. */
@@ -385,6 +386,7 @@
       complain_indent (&id_loc, warning, &indent, "%s",
                         obstack_finish0 (&msg_buf));
       obstack_free (&msg_buf, 0);
+      }
     }
 }
 
@@ -394,7 +396,8 @@
                    int midrule_rhs_index, char dollar_or_at,
                    unsigned indent)
 {
-  for (unsigned i = 0; i < variant_count; ++i)
+  unsigned i;
+  for (i = 0; i < variant_count; ++i)
     show_sub_message (warning | silent,
                       cp, explicit_bracketing,
                       midrule_rhs_index, dollar_or_at,
@@ -417,6 +420,9 @@
            int midrule_rhs_index, char *text, location text_loc,
            char dollar_or_at)
 {
+  char *cp_end;
+  bool explicit_bracketing;
+
   if ('$' == *cp)
     return LHS_REF;
 
@@ -433,9 +439,6 @@
         }
     }
 
-  char *cp_end;
-  bool explicit_bracketing;
-
   if ('[' == *cp)
     {
       /* Ignore the brackets. */
@@ -471,10 +474,11 @@
     for (symbol_index = 0, l = rule; !symbol_list_null (l);
          ++symbol_index, l = l->next)
       {
+        variant *var;
         if (l->content_type != SYMLIST_SYMBOL)
           continue;
 
-        variant *var
+        var
           = variant_add (l->content.sym->tag, l->sym_loc,
                          symbol_index, cp, cp_end, explicit_bracketing);
         if (var && l->named_ref)
@@ -486,10 +490,12 @@
       }
   }
 
+  {
   /* Check errors. */
   unsigned valid_variants = 0;
   unsigned valid_variant_index = 0;
-  for (unsigned i = 0; i < variant_count; ++i)
+  unsigned i;
+  for (i = 0; i < variant_count; ++i)
     {
       variant *var = &variant_table[i];
       unsigned symbol_index = var->symbol_index;
@@ -580,6 +586,7 @@
         return INVALID_REF;
       }
     }
+  }
 }
 
 /* Keeps track of the maximum number of semantic values to the left of
@@ -627,7 +634,7 @@
 handle_action_dollar (symbol_list *rule, char *text, location dollar_loc)
 {
   symbol_list *effective_rule;
-  int effective_rule_length;
+  int effective_rule_length, n;
 
   if (rule->midrule_parent_rule)
     {
@@ -640,12 +647,13 @@
       effective_rule_length = symbol_list_length (rule->next);
     }
 
+  {
   /* Get the type name if explicit. */
   char const *type_name = NULL;
   char *cp = fetch_type_name (text + 1, &type_name, dollar_loc);
 
-  int n = parse_ref (cp, effective_rule, effective_rule_length,
-                     rule->midrule_parent_rhs_index, text, dollar_loc, '$');
+  n = parse_ref (cp, effective_rule, effective_rule_length,
+                 rule->midrule_parent_rhs_index, text, dollar_loc, '$');
 
   /* End type_name. */
   if (type_name)
@@ -709,6 +717,7 @@
           true;
       break;
     }
+  }
 }
 
 
@@ -721,7 +730,7 @@
 handle_action_at (symbol_list *rule, char *text, location at_loc)
 {
   symbol_list *effective_rule;
-  int effective_rule_length;
+  int effective_rule_length, n;
 
   if (rule->midrule_parent_rule)
     {
@@ -736,8 +745,8 @@
 
   muscle_percent_define_ensure("locations", at_loc, true);
 
-  int n = parse_ref (text + 1, effective_rule, effective_rule_length,
-                     rule->midrule_parent_rhs_index, text, at_loc, '@');
+  n = parse_ref (text + 1, effective_rule, effective_rule_length,
+                 rule->midrule_parent_rhs_index, text, at_loc, '@');
   switch (n)
     {
     case INVALID_REF:
@@ -766,6 +775,7 @@
 translate_action (code_props *self, int sc_context)
 {
   static bool initialized = false;
+  static char *res;
   if (!initialized)
     {
       obstack_init (&obstack_for_string);
@@ -775,7 +785,7 @@
 
   loc->start = loc->end = self->location.start;
   yy_switch_to_buffer (yy_scan_string (self->code));
-  char *res = code_lex (self, sc_context);
+  res = code_lex (self, sc_context);
   yy_delete_buffer (YY_CURRENT_BUFFER);
 
   return res;
--- src/scan-gram.l	Sat Aug 25 10:55:03 2018
+++ src/scan-gram.l	Tue Sep 18 14:45:59 2018
@@ -600,8 +600,8 @@
   }
 
   \\x[0-9abcdefABCDEF]+ {
-    verify (UCHAR_MAX < ULONG_MAX);
     unsigned long c = strtoul (yytext + 2, NULL, 16);
+    verify (UCHAR_MAX < ULONG_MAX);
     if (!c || UCHAR_MAX < c)
       complain (loc, complaint, _("invalid number after \\-escape: %s"),
                    yytext+1);
@@ -847,8 +847,8 @@
 static unsigned long
 scan_integer (char const *number, int base, location loc)
 {
-  verify (INT_MAX < ULONG_MAX);
   unsigned long num = strtoul (number, NULL, base);
+  verify (INT_MAX < ULONG_MAX);
 
   if (INT_MAX < num)
     {
@@ -870,8 +870,8 @@
 static int
 convert_ucn_to_byte (char const *ucn)
 {
-  verify (UCHAR_MAX <= INT_MAX);
   unsigned long code = strtoul (ucn + 2, NULL, 16);
+  verify (UCHAR_MAX <= INT_MAX);
 
   /* FIXME: Currently we assume Unicode-compatible unibyte characters
      on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes).  On
@@ -952,10 +952,10 @@
 static void
 unexpected_end (boundary start, char const *msgid, char const *token_end)
 {
+  size_t i = strlen (token_end);
   location loc;
   loc.start = start;
   loc.end = scanner_cursor;
-  size_t i = strlen (token_end);
 
 /* Adjust scanner cursor so that any later message does not count
      the characters about to be inserted.  */
--- src/symlist.c	Sat Aug 25 10:55:03 2018
+++ src/symlist.c	Tue Sep 18 13:57:04 2018
@@ -122,11 +122,13 @@
 {
   if (!list)
     return node;
+  {
   symbol_list *next = list;
   while (next->next)
     next = next->next;
   next->next = node;
   return list;
+  }
 }
 
 
--- src/uniqstr.c	Sat Aug 25 10:55:03 2018
+++ src/uniqstr.c	Tue Sep 18 14:58:02 2018
@@ -60,15 +60,19 @@
 {
   va_list args;
   size_t length;
+  char *buff;
+  uniqstr res;
   va_start (args, format);
   length = vsnprintf (NULL, 0, format, args);
   va_end (args);
 
-  char res[length + 1];
+  buff = malloc (length + 1);
   va_start (args, format);
-  vsprintf (res, format, args);
+  vsprintf (buff, format, args);
   va_end (args);
-  return uniqstr_new (res);
+  res = uniqstr_new (buff);
+  free (buff);
+  return res;
 }
 
 /*------------------------------.
