6 ms·
The point is that the behavior depends on the optimization setting. Worse: as you saw on the example, the optimizer actually expects the result to be non-NULL!
by asomiv 15y ago
The point is that the behavior depends on the optimization setting. Worse: as you saw on the example, the optimizer actually expects the result to be non-NULL!
- kev009 15y agoIs that not the essence of undefined behavior?
- asomiv 15y agoYou're right, but would alloca(0) be undefined behavior or simply implementation-specific behavior? I think the latter would make more sense, and if so then alloca(0)'s behavior should at least be consistent and not depend on any optimization settings.
- deleted 15y ago[deleted]