That is called unspecified behavior not undefined behavior. Major difference.
I have yet to see a thorough (source-to-compiler-intent-to-assembly) comparative description of undefined, unspecified and implementation-defined behaviors, though (not just a somewhat insightful blog, or techno gospel, which the C and C++ standards are).
But yes, authoring a book titled "Well-defined C (and C++)" one day would be awesome.
Thanks for the link.