What Every C Programmer Should Know About Undefined Behavior #3/3
OK,I've vaguely looked at each of these, being a c++ programmer rather a "true" c programmer.One thing that was a little annoying was their discussion about purpose of undefined behavior. That is, I don't believe "undefined behavior" in the C Language exists for speed as such. Rather, undefined behavior is machine-specific behavior and it exists in C so the programmer can write machine specific code, the C Language being a "high-level assembly language" or "system-programmer's Swiss army knife". Speed is one outcome, certainly but there are other ways to get speed (a Just In Time Compile can come at least close naive c code). The point isn't speed. The point is "do anything", the point is that a chip designer can write c code and look on his screen to see the resulting assembler and decide where to go from there.It may be the llvm folks bypass this point because llvm is "virtual machine" rather than a chip. But it is slight annoying not to mention this if "What Every C Programmer Should Know"Perhaps they should have called their article "what C-programmers should know about optimizing compilers..."