summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-12-19 13:42:26 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-12-19 13:42:26 +0000
commit13389908dd45f4aa072f5019e222b9a560c363f7 (patch)
treee0f9c2209c931150908a9d5d8c42b451e6548006 /lib
parente4561f4baf53a1369e72b4eaf9f036c75e91b807 (diff)
downloadcoreutils-13389908dd45f4aa072f5019e222b9a560c363f7.tar.xz
Include <alloca.h> only if HAVE_ALLOCA.
(YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA. (YYMAXDEPTH): New macro.
Diffstat (limited to 'lib')
-rw-r--r--lib/getdate.y13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/getdate.y b/lib/getdate.y
index 6ffee30b9..b57e6a56d 100644
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -36,7 +36,18 @@
#include "getdate.h"
-#include <alloca.h>
+/* Use alloca only if it is known to be builtin. */
+#if HAVE_ALLOCA
+# include <alloca.h>
+#else
+# define YYSTACK_USE_ALLOCA 0
+#endif
+
+/* Tell Bison ow much stack space is needed. 20 should be plenty for
+ this grammar, which is not right recursive. Beware setting it too
+ high, since that might cause problems on machines whose alloca
+ implementations have lame stack-overflow checking. */
+#define YYMAXDEPTH 20
/* Since the code of getdate.y is not included in the Emacs executable
itself, there is no need to #define static in this file. Even if