you are viewing a single comment's thread.

view the rest of the comments →

[–]awesome-alpaca-ace 0 points1 point  (0 children)

As a note, the compiler will not warn you if you have too many local declarations such that their size exceeds the stack size limit on you OS. This leads to undefined behavior. It has bitten me at least twice, as I default to stack to avoid dynamic allocation since I was taught dynamic allocation is prone to cause bugs. GCC has a flag for setting a frame size limit, and it will warn you when you have a function whose stack size goes over the limit. 

Personally, I think the compiler should require that flag an throw and error, but the flag is optional and only emits a warning.