This is a behavior observed in MSVC and this is predictable. The
Have you tried it with all versions of MSVC at all optimization
levels? Have you tried it on the NEXT version of MSVC? Does
Microsoft documentation guarantee that the code will continue
to work the same way?
compiler is going to give me the same result whenever I execute this
code.
If you're only going to execute this code with MSVC, why not
post it only to a group for MSVC?
This is predictable. What do you mean by undefined when I am able
to define it.
The definition of "undefined behavior" is fairly clear in the C
language standard, which you do not get to re-write (and for that
matter, neither does Microsoft. And although Microsoft does like
non-standard extensions a lot, their compilers seem to follow the
standard about as well as other compiler writers.)
Do not write such irresponsible mails based on your
limitations and based on loose statements like "undefined".
The definition of "undefined behavior" in the C standard is not
loose at all. Criticizing code for containing undefined behavior
is not "irresponsible".
I do not
care what is undefined as long as it works the way it is expected to
for a specific compiler.
You're never going to upgrade your MSVC to a newer version?
Not even when it quits working on Windows 2014XL?
I encourage people to investigate this
behavior further and disseminate and find applications for such
expressions. I reiterate pls. do not write such replies.
Please do not write such code. Or if you must, please do not
release it to anyone unless they have paid you a ridiculous
amount of money for it, and especially do not post it or give
it away free.
Gordon L. Burditt