3 ms·
Function calls are not implemented safely in C. If there is no space for the next activation frame, the behavior is undefined. Allocating a non-VLA is not safe
by kazinator 7y ago
Function calls are not implemented safely in C. If there is no space for the next activation frame, the behavior is undefined.
Allocating a non-VLA is not safe. Your running program's char x[4096] could go spectacularly wrong.
- enriquto 7y ago> Your running program's char x[4096] could go spectacularly wrong. This is a tiny size, and it would never pose a problem. I'm talking about allocating a few high-resolution video frames on a VLA for temporary computation. It is extremely natural to declare these temporary space inside a for loop as for (...) { float frame[3*width*height]; // temporary data ... } but due to the "unsafety" of the VLA implementation it is not very portable. To make it safe in my linux computer I just set "ulimit -s" to a huge value and it works. But it is not very practical to distribute such code to others.
- kazinator 7y ago> This is a tiny size, and it would never pose a problem. Cribbed from some Unix programmer's epitaph.