News for hackers. Stuff that matters.
Re:Xcode 4 ships a buggy compiler by asomiv on Friday December 30, 2011 @09:27PM (#3409909)
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!
Re:Xcode 4 ships a buggy compiler by kev009 on Friday December 30, 2011 @09:33PM (#3409918)
Is that not the essence of undefined behavior?
Re:Xcode 4 ships a buggy compiler by asomiv on Friday December 30, 2011 @10:13PM (#3409995)
You'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.