News for hackers. Stuff that matters.
Re:Undefined Behavior in 2017 by lukego on Wednesday July 05, 2017 @04:46AM (#14700815)
LuaJIT is another modern low-level language. It has some remarkable undefined behavior like the evaluation order for function arguments. Scares me a bit.

https://github.com/LuaJIT/LuaJIT/issues/238

Re:Undefined Behavior in 2017 by readittwice on Wednesday July 05, 2017 @05:31AM (#14700999)
The same is true in C/C++: Function argument evaluation order is unspecified. BUT: that doesn't mean this is undefined behavior, it is just unspecified.

unspecified != undefined behavior

See this Stack overflow answer for an explanation: https://stackoverflow.com/questions/2397984/undefined-unspec...

Re:Undefined Behavior in 2017 by rbehrends on Wednesday July 05, 2017 @07:25AM (#14701507)
This would not be what is called undefined behavior per the C standard, but unspecified or implementation-defined behavior. The bad thing about "undefined behavior" is that the implementation is basically allowed to do whatever it wants, while unspecified and implementation-defined behavior still has sane semantics. Unspecified behavior allows the language implementation to choose any one from several possible implementations, implementation-defined behavior requires the language implementation to define the semantics itself.
Re:Undefined Behavior in 2017 by chii on Wednesday July 05, 2017 @05:10AM (#14700914)
lua is no way a "low level" language
Re:Undefined Behavior in 2017 by eru on Wednesday July 05, 2017 @09:52AM (#14702361)
Are you sure that undefined, instead of merely unspecified?

Ie function arguments are still evaluated in some (possibly changing) order. C++ undefined behavior allows to eg format your hard disk or launch the nukes.