(union yyalloc): Do not evaluate
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 May 2003 06:44:08 +0000 (06:44 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 May 2003 06:44:08 +0000 (06:44 +0000)
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).
(YYCOPY): Do not evaluate __GNUC__ unless it is defined.

data/yacc.c

index 4ee09fb..359a900 100644 (file)
@@ -248,7 +248,8 @@ b4_syncline([@oline@], [@ofile@])[
 
 #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