Segmentation fault when jumping to goto over VLA array
问题 The following example demonstrates the issue: #include <cstdio> int main() { unsigned int remaining=1; goto loop; while(remaining) { unsigned char tmp[remaining]; printf("&tmp: %p\n",tmp); loop: remaining = 512;//or something else; } } Initially, the initialization of "remaining" variable was a bit long and I used goto to initialize it on one line. However, now this example gives segmentation fault on the printf line. It looks like the array is not initialized properly. Even gdb cannot print