bison-patches
[Top][All Lists]
Advanced

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

patch for undefined symbols in #if in Bison templates


From: Paul Eggert
Subject: patch for undefined symbols in #if in Bison templates
Date: Sat, 24 May 2003 23:48:44 -0700 (PDT)

I installed this.  Unfortunately the bug report, and the earlier
message I sent to bug-bison about this, don't seem to be archived.

2003-05-24  Paul Eggert  <address@hidden>

        * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
        YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
        This fixes a problem reported by John Bowman when the Compaq/HP
        Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
        -ansi -Wall -gall).
        * data/yacc.c (union yyalloc): Likewise.
        (YYCOPY): Do not evaluate __GNUC__ unless it is defined.

Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.54
diff -p -u -r1.54 glr.c
--- data/glr.c  21 Apr 2003 19:37:09 -0000      1.54
+++ data/glr.c  24 May 2003 21:24:48 -0000
@@ -510,7 +510,8 @@ int yydebug;
 
 #if (! defined (YYSTACKEXPANDABLE) \
      && (! defined (__cplusplus) \
-        || (]b4_location_if([YYLTYPE_IS_TRIVIAL && ])[YYSTYPE_IS_TRIVIAL)))
+        || (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && 
YYLTYPE_IS_TRIVIAL \
+            && ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
 #define YYSTACKEXPANDABLE 1
 #else
 #define YYSTACKEXPANDABLE 0
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.56
diff -p -u -r1.56 yacc.c
--- data/yacc.c 29 Apr 2003 06:04:04 -0000      1.56
+++ data/yacc.c 24 May 2003 21:24:48 -0000
@@ -248,7 +248,8 @@ b4_syncline(address@hidden@], address@hidden@])[
 
 #if (! defined (yyoverflow) \
      && (! defined (__cplusplus) \
-        || (]b4_location_if([YYLTYPE_IS_TRIVIAL && ])[YYSTYPE_IS_TRIVIAL)))
+        || (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && 
YYLTYPE_IS_TRIVIAL \
+             && ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
@@ -275,7 +276,7 @@ union yyalloc
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
-#  if 1 < __GNUC__
+#  if defined (__GNUC__) && 1 < __GNUC__
 #   define YYCOPY(To, From, Count) \
       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 #  else




reply via email to

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