I installed the attached patch, which should work around the clang 8 bug. At least, it fixes things on Fedora 30, which has clang version 8.0.0 (Fedora 8.0.0-3.fc30).
>From e69b47cd189d7eb45668acce4cf17815401bf2a5 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sat, 5 Oct 2019 03:41:53 -0700
Subject: [PATCH] * data/skeletons/glr.c (yysplitStack): Pacify Clang 8.

---
 data/skeletons/glr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/data/skeletons/glr.c b/data/skeletons/glr.c
index 0e8f60e9..c3c1a9a4 100644
--- a/data/skeletons/glr.c
+++ b/data/skeletons/glr.c
@@ -1506,7 +1506,8 @@ yysplitStack (yyGLRStack* yystackp, ptrdiff_t yyk)
     {
       yyGLRState** yynewStates = YY_NULLPTR;
       yybool* yynewLookaheadNeeds;
-      ptrdiff_t half_max_capacity = YYSIZEMAX / (2 * sizeof yynewStates[0]);
+      ptrdiff_t state_size = sizeof yynewStates[0];
+      ptrdiff_t half_max_capacity = YYSIZEMAX / 2 / state_size;
 
       if (half_max_capacity < yystackp->yytops.yycapacity)
         yyMemoryExhausted (yystackp);
-- 
2.17.1

Reply via email to