bison-patches
[Top][All Lists]
Advanced

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

cxx-type.at patch for overly picky C compilers


From: Paul Eggert
Subject: cxx-type.at patch for overly picky C compilers
Date: Wed, 20 Jul 2005 14:20:28 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I installed this:

2005-07-20  Paul Eggert  <address@hidden>

        * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
        overly-picky compilers that reject 'char *foo = "bar";'.

--- tests/cxx-type.at   19 Jul 2005 03:32:40 -0000      1.24
+++ tests/cxx-type.at   20 Jul 2005 21:00:43 -0000
@@ -82,7 +82,7 @@ prog :
 
 stmt : expr ';'  $2    { $$ = ]$[1; }
      | decl      $3
-     | error ';'       { $$ = "<error>"; }
+     | error ';'       { static char error_msg[] = "<error>"; $$ = error_msg; }
      | '@'             { YYACCEPT; }
      ;
 
@@ -178,9 +178,10 @@ yylex (LEX_PARAMETERS)
              }
            else
              {
+               static char empty_string[] = "";
                colNum += 1;
                tok = c;
-               yylval = "";
+               yylval = empty_string;
              }
 #if YYLSP_NEEDED
            yylloc.last_column = colNum-1;




reply via email to

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