How does an uninitialized local pointer work in STM32?
I have the following bug in my project and cannot figure out why.
In one function I was using an uninitialized pointer variable to receive data from another function. For some reason it works which I think shouldn't. The code is like this:
funcA
{
msg* pmsg;
other variables;
funcB(pmsg);
if(pmsg->memberA)
{
.....
}
if(pmsg->memberB)
{
.....
}
}
The function has been worked for a while. Does the uninitialized local variable be set to garbage value? If so, how does this thing work? Then I debug it, this pointer is always set to value 0 and I can also check the data it received. Address 0 doesn't belong to any memory section in STM32. ANybody can help? Thanks.
