-
Notifications
You must be signed in to change notification settings - Fork 602
Open
Description
For my virtual machine, the clang++ version is "Ubuntu clang version 14.0.0-1ubuntu1", and the g++ version is "gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)".
I tried both of them, but still got failed to compile it, here is the terminal output when using clang++:
clang++ -Ilib -Icommon -Iexternals/tinyxml -std=c++0x -O2 -include lib/cxx11emu.h -DNDEBUG -Wall -Wno-sign-compare -Wno-unknown-pragmas -Wno-reorder -c -o cli/tscexecutor.o cli/tscexecutor.cpp
cli/tscexecutor.cpp:322:13: error: variable length array declaration not allowed at file scope
static char mytstack[MYSTACKSIZE]; // alternative stack for signal handler
^ ~~~~~~~~~~~
1 error generated.
make: *** [Makefile:284: cli/tscexecutor.o] Error 1
Obviously, the option "-std=c++0x" is already specified in the compile command, but the compiler still said the length of the array "mytstack" is not constant, so I checked the code at cli/tscexecutor.cpp:322:13:
static const size_t MYSTACKSIZE = 16 * 1024 + SIGSTKSZ; // wild guess about a reasonable buffer
static char mytstack[MYSTACKSIZE]; // alternative stack for signal handler
static bool bStackBelowHeap = false; // lame attempt to locate heap vs. stack address space
SIGTKSZ is now not a macro anymore, here is the news.
Maybe it's a better choice to allocate this array dynamically now.
janhkrueger
Metadata
Metadata
Assignees
Labels
No labels