]> git.saurik.com Git - bison.git/commitdiff
Merge branch 'maint'
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 31 Jul 2012 09:50:18 +0000 (11:50 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Tue, 31 Jul 2012 10:03:55 +0000 (12:03 +0200)
* maint:
  use obstack_printf
  scanner: restore a missing start condition
  gnulib: update
  maint: post-release administrivia
  version 2.6.1
  gnulib: update
  maint: fix some syntax-check issues
  tests: do not depend on __cplusplus to decide for C++ or C output

Conflicts:
NEWS
bootstrap.conf
cfg.mk
lib/.gitignore

16 files changed:
.prev-version
NEWS
bootstrap.conf
cfg.mk
gnulib
lib/.gitignore
m4/.gitignore
src/conflicts.c
src/muscle-tab.c
src/muscle-tab.h
src/output.c
src/print_graph.c
src/scan-code.l
src/scan-skel.l
src/system.h
tests/actions.at

index 5154b3f68e9afc8b2e239deba25eed650425e3ce..6a6a3d8e35c7a98eaeb47d4212cc13d1d8938003 100644 (file)
@@ -1 +1 @@
-2.6
+2.6.1
diff --git a/NEWS b/NEWS
index fa1b948f57e090eef5e955ffc0a13cac480ff89f..bd47608b551782d521d8140b3ff3b89b1588846d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -141,6 +141,9 @@ GNU Bison NEWS
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+
+* Noteworthy changes in release 2.6.1 (2012-07-30) [stable]
+
  Bison no longer executes user-specified M4 code when processing a grammar.
 
 ** Future Changes
index 486268d715d15edc5e57e10c3e6d2cfd9baa5225..e90cf12d4d0e01da3e784bf38194f4528f5701b8 100644 (file)
@@ -24,7 +24,10 @@ gnulib_modules='
   gettext git-version-gen gitlog-to-changelog
   gpl-3.0 hash inttypes isnan javacomp-script
   javaexec-script ldexpl malloc-gnu
-  mbswidth obstack perror progname
+  mbswidth
+  obstack
+  obstack-printf
+  perror progname
   quote quotearg
   readme-release
   realloc-posix
diff --git a/cfg.mk b/cfg.mk
index f1caf313e85f360c41d0ccfdfe874746dcc7a31c..af1e09e8d94cedef4c9ff5a76fd2766ba6d2e20b 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -59,12 +59,14 @@ exclude = \
 $(call exclude,                                                                \
   bindtextdomain=^lib/main.c$$                                         \
   program_name=^lib/main.c$$                                           \
-  prohibit_always-defined_macros=^data/yacc.c|^djgpp/                  \
+  prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/                        \
   prohibit_always-defined_macros+=?|^lib/timevar.c$$                   \
   prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$     \
   prohibit_always-defined_macros+=?|^tests/regression.at$$             \
   prohibit_defined_have_decl_tests=?|^lib/timevar.c$$                  \
   prohibit_empty_lines_at_EOF=^src/parse-gram.h$$                      \
+  prohibit_magic_number_exit=^doc/bison.texi$$                         \
+  prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$     \
   prohibit_strcmp=^doc/bison\.texi$$                                   \
   require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$           \
   space_tab=^tests/(input|c\+\+)\.at$$                                 \
diff --git a/gnulib b/gnulib
index dbd914496c99c52220e5f5ba4121d6cb55fb3beb..678815ea7c4d95e04a0fa6d3b491b3c872c677a7 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit dbd914496c99c52220e5f5ba4121d6cb55fb3beb
+Subproject commit 678815ea7c4d95e04a0fa6d3b491b3c872c677a7
index 8e0e20968eb2bf600463e1d4d7bfbff1ff7c77a2..a448e841ed2b304f9343fd3799e7db08d1f95e11 100644 (file)
@@ -35,6 +35,8 @@
 /close.c
 /closeout.c
 /closeout.h
+/concat-filename.c
+/concat-filename.h
 /config.charset
 /config.h
 /config.in.h
@@ -62,6 +64,7 @@
 /fd-hook.h
 /fd-safer-flag.c
 /fd-safer.c
+/filename.h
 /float+.h
 /float.c
 /float.h
 /nonblocking.h
 /obstack.c
 /obstack.h
+/obstack_printf.c
 /open.c
 /pathmax.h
 /perror.c
 /sys_socket.in.h
 /sys_stat.h
 /sys_stat.in.h
+/sys_types.in.h
 /sys_wait.h
 /sys_wait.in.h
 /sysexits.in.h
 /xalloc-die.c
 /xalloc-oversized.h
 /xalloc.h
+/xconcat-filename.c
 /xmalloc.c
+/xmemdup0.c
+/xmemdup0.h
 /xsize.h
 /xstrndup.c
 /xstrndup.h
-/xmemdup0.c
-/xmemdup0.h
-/sys_types.in.h
-/concat-filename.c
-/concat-filename.h
-/filename.h
-/xconcat-filename.c
index 875400a9839458282f1096ab5648644fb3437050..c6a84ce83eaf0615dd72c061816e858300f897fc 100644 (file)
 /xalloc.m4
 /xsize.m4
 /xstrndup.m4
+/obstack-printf.m4
index ccd50ebf78d72b01c40fbcdd2ac3d708af4ef079..dad6568391e62e318c72117ee338b5c88a3d163f 100644 (file)
@@ -73,7 +73,7 @@ log_resolution (rule *r, symbol_number token,
         {
         case shift_resolution:
         case right_resolution:
-          obstack_fgrow2 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           _("    Conflict between rule %d and token %s"
                             " resolved as shift"),
                           r->number,
@@ -82,7 +82,7 @@ log_resolution (rule *r, symbol_number token,
 
         case reduce_resolution:
         case left_resolution:
-          obstack_fgrow2 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           _("    Conflict between rule %d and token %s"
                             " resolved as reduce"),
                           r->number,
@@ -90,7 +90,7 @@ log_resolution (rule *r, symbol_number token,
           break;
 
         case nonassoc_resolution:
-          obstack_fgrow2 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           _("    Conflict between rule %d and token %s"
                             " resolved as an error"),
                           r->number,
@@ -102,33 +102,33 @@ log_resolution (rule *r, symbol_number token,
       switch (resolution)
         {
         case shift_resolution:
-          obstack_fgrow2 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           " (%s < %s)",
                           r->prec->tag,
                           symbols[token]->tag);
           break;
 
         case reduce_resolution:
-          obstack_fgrow2 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           " (%s < %s)",
                           symbols[token]->tag,
                           r->prec->tag);
           break;
 
         case left_resolution:
-          obstack_fgrow1 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           " (%%left %s)",
                           symbols[token]->tag);
           break;
 
         case right_resolution:
-          obstack_fgrow1 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           " (%%right %s)",
                           symbols[token]->tag);
           break;
 
         case nonassoc_resolution:
-          obstack_fgrow1 (&solved_conflicts_obstack,
+          obstack_printf (&solved_conflicts_obstack,
                           " (%%nonassoc %s)",
                           symbols[token]->tag);
           break;
@@ -145,7 +145,7 @@ log_resolution (rule *r, symbol_number token,
         {
         case shift_resolution:
         case right_resolution:
-          obstack_fgrow2 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "        <resolution rule=\"%d\" symbol=\"%s\""
                           " type=\"shift\">",
                           r->number,
@@ -154,7 +154,7 @@ log_resolution (rule *r, symbol_number token,
 
         case reduce_resolution:
         case left_resolution:
-          obstack_fgrow2 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "        <resolution rule=\"%d\" symbol=\"%s\""
                           " type=\"reduce\">",
                           r->number,
@@ -162,7 +162,7 @@ log_resolution (rule *r, symbol_number token,
           break;
 
         case nonassoc_resolution:
-          obstack_fgrow2 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "        <resolution rule=\"%d\" symbol=\"%s\""
                           " type=\"error\">",
                           r->number,
@@ -174,33 +174,33 @@ log_resolution (rule *r, symbol_number token,
       switch (resolution)
         {
         case shift_resolution:
-          obstack_fgrow2 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "%s &lt; %s",
                           xml_escape_n (0, r->prec->tag),
                           xml_escape_n (1, symbols[token]->tag));
           break;
 
         case reduce_resolution:
-          obstack_fgrow2 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "%s &lt; %s",
                           xml_escape_n (0, symbols[token]->tag),
                           xml_escape_n (1, r->prec->tag));
           break;
 
         case left_resolution:
-          obstack_fgrow1 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "%%left %s",
                           xml_escape (symbols[token]->tag));
           break;
 
         case right_resolution:
-          obstack_fgrow1 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "%%right %s",
                           xml_escape (symbols[token]->tag));
           break;
 
         case nonassoc_resolution:
-          obstack_fgrow1 (&solved_conflicts_xml_obstack,
+          obstack_printf (&solved_conflicts_xml_obstack,
                           "%%nonassoc %s",
                           xml_escape (symbols[token]->tag));
       break;
index 1168a9c33e5d7e6604d025c63be2977d49b24edd..bb54bed75a760100fa804362b7eec974c28d349d 100644 (file)
@@ -177,7 +177,7 @@ static void
 muscle_syncline_grow (char const *key, location loc)
 {
   char *extension = NULL;
-  obstack_fgrow1 (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
+  obstack_printf (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
   obstack_quote (&muscle_obstack,
                  quotearg_style (c_quoting_style, loc.start.file));
   obstack_sgrow (&muscle_obstack, ")[");
@@ -269,9 +269,9 @@ muscle_boundary_grow (char const *key, boundary bound)
   obstack_sgrow  (&muscle_obstack, "[[");
   obstack_escape (&muscle_obstack, bound.file);
   obstack_1grow (&muscle_obstack, ':');
-  obstack_fgrow1 (&muscle_obstack, "%d", bound.line);
+  obstack_printf (&muscle_obstack, "%d", bound.line);
   obstack_1grow (&muscle_obstack, '.');
-  obstack_fgrow1 (&muscle_obstack, "%d", bound.column);
+  obstack_printf (&muscle_obstack, "%d", bound.column);
   obstack_sgrow  (&muscle_obstack, "]]");
   obstack_1grow (&muscle_obstack, '\0');
   extension = obstack_finish (&muscle_obstack);
index 1f33f8c15a9bf1fc67750a654bd93dccdce825e5..ac852978439fbefb542e33c66ed16966d17b28e5 100644 (file)
@@ -42,14 +42,14 @@ extern struct obstack muscle_obstack;
 
 #define MUSCLE_INSERT_INT(Key, Value)                           \
   do {                                                          \
-    obstack_fgrow1 (&muscle_obstack, "%d", Value);              \
+    obstack_printf (&muscle_obstack, "%d", Value);              \
     obstack_1grow (&muscle_obstack, 0);                         \
     muscle_insert (Key, obstack_finish (&muscle_obstack));      \
   } while (0)
 
 #define MUSCLE_INSERT_LONG_INT(Key, Value)                      \
   do {                                                          \
-    obstack_fgrow1 (&muscle_obstack, "%ld", Value);             \
+    obstack_printf (&muscle_obstack, "%ld", Value);             \
     obstack_1grow (&muscle_obstack, 0);                         \
     muscle_insert (Key, obstack_finish (&muscle_obstack));      \
   } while (0)
index c227be223f4c89749696305e8aebc7f5ed3365d9..24bb83cd146331c7ae337072a2cee56fb9c7af09 100644 (file)
@@ -69,7 +69,7 @@ Name (char const *name,                                                 \
   int i;                                                                \
   int j = 1;                                                            \
                                                                         \
-  obstack_fgrow1 (&format_obstack, "%6d", first);                       \
+  obstack_printf (&format_obstack, "%6d", first);                       \
   for (i = begin; i < end; ++i)                                         \
     {                                                                   \
       obstack_1grow (&format_obstack, ',');                             \
@@ -80,7 +80,7 @@ Name (char const *name,                                                 \
         }                                                               \
       else                                                              \
         ++j;                                                            \
-      obstack_fgrow1 (&format_obstack, "%6d", table_data[i]);           \
+      obstack_printf (&format_obstack, "%6d", table_data[i]);           \
       if (table_data[i] < min)                                          \
         min = table_data[i];                                            \
       if (max < table_data[i])                                          \
@@ -92,10 +92,10 @@ Name (char const *name,                                                 \
   lmin = min;                                                           \
   lmax = max;                                                           \
   /* Build `NAME_min' and `NAME_max' in the obstack. */                 \
-  obstack_fgrow1 (&format_obstack, "%s_min", name);                     \
+  obstack_printf (&format_obstack, "%s_min", name);                     \
   obstack_1grow (&format_obstack, 0);                                   \
   MUSCLE_INSERT_LONG_INT (obstack_finish (&format_obstack), lmin);      \
-  obstack_fgrow1 (&format_obstack, "%s_max", name);                     \
+  obstack_printf (&format_obstack, "%s_max", name);                     \
   obstack_1grow (&format_obstack, 0);                                   \
   MUSCLE_INSERT_LONG_INT (obstack_finish (&format_obstack), lmax);      \
 }
@@ -410,13 +410,13 @@ prepare_symbol_definitions (void)
       const char *value;
 
 #define SET_KEY(Entry)                                          \
-      obstack_fgrow2 (&format_obstack, "symbol(%d, %s)",        \
+      obstack_printf (&format_obstack, "symbol(%d, %s)",        \
                       i, Entry);                                \
       obstack_1grow (&format_obstack, 0);                       \
       key = obstack_finish (&format_obstack);
 
 #define SET_KEY2(Entry, Suffix)                                 \
-      obstack_fgrow3 (&format_obstack, "symbol(%d, %s_%s)",     \
+      obstack_printf (&format_obstack, "symbol(%d, %s_%s)",     \
                       i, Entry, Suffix);                        \
       obstack_1grow (&format_obstack, 0);                       \
       key = obstack_finish (&format_obstack);
index 61d3651297342ef40bdd1d69a5fc5297f2dbe0ae..d37afb2cd9d45c3fe36d208101f5941c2251f778 100644 (file)
@@ -54,7 +54,7 @@ print_core (struct obstack *oout, state *s)
       snritems = nitemset;
     }
 
-  obstack_fgrow1 (oout, "%d", s->number);
+  obstack_printf (oout, "%d", s->number);
   for (i = 0; i < snritems; i++)
     {
       item_number *sp;
@@ -68,15 +68,15 @@ print_core (struct obstack *oout, state *s)
 
       r = item_number_as_rule_number (*sp);
 
-      obstack_fgrow1 (oout, "\n%s -> ", rules[r].lhs->tag);
+      obstack_printf (oout, "\n%s -> ", rules[r].lhs->tag);
 
       for (sp = rules[r].rhs; sp < sp1; sp++)
-        obstack_fgrow1 (oout, "%s ", symbols[*sp]->tag);
+        obstack_printf (oout, "%s ", symbols[*sp]->tag);
 
       obstack_1grow (oout, '.');
 
       for (/* Nothing */; *sp >= 0; ++sp)
-        obstack_fgrow1 (oout, " %s", symbols[*sp]->tag);
+        obstack_printf (oout, " %s", symbols[*sp]->tag);
 
       /* Experimental feature: display the lookahead tokens. */
       if (report_flag & report_lookahead_tokens
@@ -95,7 +95,7 @@ print_core (struct obstack *oout, state *s)
               obstack_sgrow (oout, "[");
               BITSET_FOR_EACH (biter, reds->lookahead_tokens[redno], k, 0)
                 {
-                  obstack_fgrow2 (oout, "%s%s", sep, symbols[k]->tag);
+                  obstack_printf (oout, "%s%s", sep, symbols[k]->tag);
                   sep = ", ";
                 }
               obstack_sgrow (oout, "]");
index 2fe880ed6a371d03215cc19af83d16320a6759e7..83501475fe9107292fe1fb1d03c5b945e711f4df 100644 (file)
@@ -435,30 +435,30 @@ show_sub_messages (const char* cp, bool explicit_bracketing,
           /* Create the explanation message. */
           obstack_init (&msg_buf);
 
-          obstack_fgrow1 (&msg_buf, _("possibly meant: %c"), dollar_or_at);
+          obstack_printf (&msg_buf, _("possibly meant: %c"), dollar_or_at);
           if (contains_dot_or_dash (id))
-            obstack_fgrow1 (&msg_buf, "[%s]", id);
+            obstack_printf (&msg_buf, "[%s]", id);
           else
             obstack_sgrow (&msg_buf, id);
           obstack_sgrow (&msg_buf, tail);
 
           if (var->err & VARIANT_HIDDEN)
             {
-              obstack_fgrow1 (&msg_buf, _(", hiding %c"), dollar_or_at);
+              obstack_printf (&msg_buf, _(", hiding %c"), dollar_or_at);
               if (contains_dot_or_dash (var->id))
-                obstack_fgrow1 (&msg_buf, "[%s]", var->id);
+                obstack_printf (&msg_buf, "[%s]", var->id);
               else
                 obstack_sgrow (&msg_buf, var->id);
               obstack_sgrow (&msg_buf, tail);
             }
 
-          obstack_fgrow1 (&msg_buf, _(" at %s"), at_spec);
+          obstack_printf (&msg_buf, _(" at %s"), at_spec);
 
           if (var->err & VARIANT_NOT_VISIBLE_FROM_MIDRULE)
             {
               const char *format =
                 _(", cannot be accessed from mid-rule action at $%d");
-              obstack_fgrow1 (&msg_buf, format, midrule_rhs_index);
+              obstack_printf (&msg_buf, format, midrule_rhs_index);
             }
 
           obstack_1grow (&msg_buf, '\0');
@@ -784,7 +784,7 @@ handle_action_dollar (symbol_list *rule, char *text, location dollar_loc)
             untyped_var_seen = true;
         }
 
-      obstack_fgrow2 (&obstack_for_string,
+      obstack_printf (&obstack_for_string,
                       "]b4_rhs_value(%d, %d, ", effective_rule_length, n);
       obstack_quote (&obstack_for_string, type_name);
       obstack_sgrow (&obstack_for_string, ")[");
@@ -834,7 +834,7 @@ handle_action_at (symbol_list *rule, char *text, location at_loc)
       break;
 
     default:
-      obstack_fgrow2 (&obstack_for_string, "]b4_rhs_location(%d, %d)[",
+      obstack_printf (&obstack_for_string, "]b4_rhs_location(%d, %d)[",
                       effective_rule_length, n);
       break;
     }
index b79e58323e0cc2a95fc1232c6437ed2a56099151..32bfe7374914ef6602a51482c7049c653bbefbab 100644 (file)
@@ -91,7 +91,7 @@ static void fail_for_invalid_at (char const *at);
 \n         out_lineno++; ECHO;
 [^@\n]+    ECHO;
 
-<<EOF>> {
+<INITIAL><<EOF>> {
   if (outname)
     {
       free (outname);
index 1d0af8fabddb6e7b5c10678dc1288de5c9abd369..a56c058a10360c7d867f350e859844bd7680b864 100644 (file)
@@ -176,35 +176,6 @@ typedef size_t uintptr_t;
 #define obstack_sgrow(Obs, Str) \
   obstack_grow (Obs, Str, strlen (Str))
 
-#define obstack_fgrow1(Obs, Format, Arg1)       \
-  do {                                          \
-    char buf[4096];                             \
-    sprintf (buf, Format, Arg1);                \
-    obstack_grow (Obs, buf, strlen (buf));      \
-  } while (0)
-
-#define obstack_fgrow2(Obs, Format, Arg1, Arg2) \
-  do {                                          \
-    char buf[4096];                             \
-    sprintf (buf, Format, Arg1, Arg2);          \
-    obstack_grow (Obs, buf, strlen (buf));      \
-  } while (0)
-
-#define obstack_fgrow3(Obs, Format, Arg1, Arg2, Arg3)   \
-  do {                                                  \
-    char buf[4096];                                     \
-    sprintf (buf, Format, Arg1, Arg2, Arg3);            \
-    obstack_grow (Obs, buf, strlen (buf));              \
-  } while (0)
-
-#define obstack_fgrow4(Obs, Format, Arg1, Arg2, Arg3, Arg4)     \
-  do {                                                          \
-    char buf[4096];                                             \
-    sprintf (buf, Format, Arg1, Arg2, Arg3, Arg4);              \
-    obstack_grow (Obs, buf, strlen (buf));                      \
-  } while (0)
-
-
 /* Output Str escaped for our postprocessing (i.e., escape M4 special
    characters).
 
index 16711ddd91d8fda554efbb2c62d75b150e060991..269bcce50533a68b3002413d1d54c068e5ba278a 100644 (file)
@@ -1281,8 +1281,6 @@ AT_DATA_GRAMMAR([[input.y]],
 %debug
 %code requires
 {
-# include <stdio.h>
-
   typedef struct sem_type
   {
     int ival;
@@ -1291,20 +1289,21 @@ AT_DATA_GRAMMAR([[input.y]],
 
 # define YYSTYPE sem_type
 
-#ifdef __cplusplus
+]AT_SKEL_CC_IF([[
 # include <iostream>
   static void
   report (std::ostream& yyo, int ival, float fval)
   {
     yyo << "ival: " << ival << ", fval: " <<  fval;
   }
-#else
+]], [[
+# include <stdio.h>
   static void
   report (FILE* yyo, int ival, float fval)
   {
     fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
   }
-#endif
+]])[
 }
 
 %code