From: Paul Eggert Date: Mon, 28 Apr 2003 06:03:58 +0000 (+0000) Subject: Avoid gcc -Wundef warnings reported by Gerald Pfeifer in X-Git-Tag: BISON-2_0~325 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/b929851a33abe7f23de15cdb60d63be4a8bbc0a0?ds=sidebyside Avoid gcc -Wundef warnings reported by Gerald Pfeifer in . (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA if it is not defined. (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined. --- diff --git a/data/yacc.c b/data/yacc.c index eb0b7b30..d2a3c558 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -218,16 +218,16 @@ b4_syncline([@oline@], [@ofile@])[ /* The parser invokes alloca or malloc; define the necessary symbols. */ -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# endif # else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif @@ -622,7 +622,7 @@ int yydebug; SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 +#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif