3 ms·
I'm not sure how a restriction would work. The kernel stack is 16kb (meaning uint16_t is already unsafe) & you don't actually know where in the stack you are w
by vlovich123 8y ago
I'm not sure how a restriction would work. The kernel stack is 16kb (meaning uint16_t is already unsafe) & you don't actually know where in the stack you are when creating the VLA so even if you did restrict yourself to uint8_t that doesn't protect you in any way.
- tropo 8y agoYou're no less protected than you are when you call a function. Nothing ensures that a function can safely be called. uint8_t is effective protection, given the normal assumption of a stack with 4096 to 16384 bytes of space and a call stack that isn't insane. If you wish to make a formal proof of correctness, feel free to make worst-case assumptions.