title: How to debug stack overflow in long if/else tree with many small static arrays
body: <p>I'm trying to compile and run a c++ project that someone else wrote. This works in MacOS and linux but fails with a stack overflow on Windows using MS Visual Studio 2022. The problem is in a huge function that has thousands upon thousands of cases in an if-else tree where the inner nestings have assorted multi-dimensional static arrays. For example, something like this, but 4500 lines long:</p>
  <pre><code>void foo(int mode) {
    if (mode == 0) {
      int vals[2][5];
      ...
    }
    else if (mode == 1) {
      int vals[3][6][2];
      ...
    }
    ...
  }
  </code></pre>
  <p>How would typical compilers such as gcc and MS Visual Studio allocate stack space for this type of code pattern?</p>