bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison glr regression fix.


From: Paul Eggert
Subject: Re: Bison glr regression fix.
Date: Thu, 08 Sep 2005 11:42:26 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden writes:

> in data/glr-regression.at a cast at the malloc()
> seems to be missing. g++ 3.3.4 complained, should be:
>   char *value = (char *) malloc (strlen (parent) + strlen (child) + sizeof
> format);
>   char *value = (char *) malloc (strlen (s1.ptr) + strlen (s2.ptr) +

Thanks.  I guess g++ 4.0.1 doesn't complain any more?  Weird.  Anyway,
I installed this:

2005-09-08  Paul Eggert  <address@hidden>

        * tests/glr-regression.at (Duplicate representation of merged trees):
        Add casts to pacify g++.  Problem reported by address@hidden

--- tests/glr-regression.at     26 Aug 2005 20:16:16 -0000      1.15
+++ tests/glr-regression.at     8 Sep 2005 18:40:23 -0000
@@ -389,7 +389,8 @@ static char *
 make_value (char *parent, char *child)
 {
   char const format[] = "%s <- %s";
-  char *value = malloc (strlen (parent) + strlen (child) + sizeof format);
+  char *value =
+    (char *) malloc (strlen (parent) + strlen (child) + sizeof format);
   sprintf (value, format, parent, child);
   return value;
 }
@@ -398,7 +399,8 @@ static char *
 merge (YYSTYPE s1, YYSTYPE s2)
 {
   char const format[] = "merge{ %s and %s }";
-  char *value = malloc (strlen (s1.ptr) + strlen (s2.ptr) + sizeof format);
+  char *value =
+    (char *) malloc (strlen (s1.ptr) + strlen (s2.ptr) + sizeof format);
   sprintf (value, format, s1.ptr, s2.ptr);
   return value;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]