Consider the following code (for demonstration purposes only):
#include <iostream>
int main()
{
char pixels[4][1280][720]; // Big enough to cause a stack overflow on my machine
for (unsigned int i = 0; i < 4; i++)
{
for (unsigned int j = 0; j < 1280; j++)
{
for (unsigned int k = 0; k < 720; k++)
{
pixels[i][j][k] = i + j + k;
}
}
}
std::cout << pixels[2][640][360];
return 0;
}
According to answers on this question, the maximum stack size is set by visual studio.
Am I correct in assuming it could warn users about a potential stack overflow? (I tried this myself and didn't get a warning)
P.S: The only reason I'm asking is because I see a lot of questions on SO that could be prevented by such a warning (Yes I know not everyone SO user uses VS).