Avoid gcc -Wundef warnings reported by Gerald Pfeifer in

<http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
(YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA if it is not defined.
(YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
This commit is contained in:
Paul Eggert
2003-04-28 06:03:58 +00:00
parent 3470c57bea
commit b929851a33

View File

@@ -218,16 +218,16 @@ b4_syncline([@oline@], [@ofile@])[
/* The parser invokes alloca or malloc; define the necessary symbols. */ /* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA # ifdef YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca # if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
# endif
# else # else
# ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H)
# if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca
# define YYSTACK_ALLOC alloca # else
# else # ifdef __GNUC__
# ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca
# define YYSTACK_ALLOC __builtin_alloca
# endif
# endif # endif
# endif # endif
# endif # endif
@@ -622,7 +622,7 @@ int yydebug;
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */ evaluated with infinite-precision integer arithmetic. */
#if YYMAXDEPTH == 0 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
# undef YYMAXDEPTH # undef YYMAXDEPTH
#endif #endif