Compilation error: size of array 'altstack' is not an integral constant-expression

  • OpenMW version: 0.46.0
  • OS: openSUSE Tumbleweed

Compilation fail with message as in the title.

My proposed solution:

Index: openmw-openmw-0.46.0/components/crashcatcher/crashcatcher.cpp
===================================================================
--- openmw-openmw-0.46.0.orig/components/crashcatcher/crashcatcher.cpp
+++ openmw-openmw-0.46.0/components/crashcatcher/crashcatcher.cpp
@@ -56,8 +56,6 @@ static const char exec_err[] = "!!! Fail
 
 static char argv0[PATH_MAX];
 
-static char altstack[SIGSTKSZ];
-
 
 static struct {
     int signum;
@@ -467,9 +465,9 @@ int crashCatcherInstallHandlers(int argc
 
     /* Set an alternate signal stack so SIGSEGVs caused by stack overflows
      * still run */
-    altss.ss_sp = altstack;
+    altss.ss_sp = malloc(SIGSTKSZ);
     altss.ss_flags = 0;
-    altss.ss_size = sizeof(altstack);
+    altss.ss_size = SIGSTKSZ;
     sigaltstack(&altss, nullptr);
 
     memset(&sa, 0, sizeof(sa));