Subject: Re: Using gotos with local variables in "extra" blocks: Does it get deallocated?
Tim Rentsch <
tr.17687@z991.linuxsc.com> writes:
scott@slp53.sl.home (Scott Lurndal) writes:
[...]
int fff(int yyy, int xxx)
{
int ab = yyy + xxx;
{
int bb;
printf("%p\n", &bb);
}
{
int bc;
printf("%p\n", &bc);
}
printf("%p\n", &ab);
return 0;
}
This function has undefined behavior.
Yes, it has undefined behavior because "%p" requires an argument
of type void*. The second argument in each printf call should be
cast to void*.
Is that what you're referring to? Do you see any other instance
of undefined behavior (assuming xxx + yyy doesn't overflow)?
--
Keith Thompson (The_Other_Keith)
Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
--- PyGate Linux v1.5.15
* Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)