[cfe-dev] Understand assumptions towards uninitialized variables on stack

Andrea Bocci via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 21 00:26:35 PST 2018


Hi Irene,
I am not an expert, but here is my interpretation: "undefined behaviour"
means that the behaviour observed by the person running the compiled
program is not dictated by the C++ standard, and thus the compiler is free
to do whatever it wants.

Setting the value of an uninitialised variable to zero, or to any arbitrary
number, or to a random number, or not setting it at all, would be
acceptable behaviours for "undefined behaviour".

Ciao,
.Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181121/c588714f/attachment.html>


More information about the cfe-dev mailing list