This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] pthread_cleanup_push macro generates warning when -Wclobbered is set
On 11/21/2017 03:00 AM, Florian Weimer wrote:
I think the standard assumes that storage for all local variables is
allocated when the function is entered (or when a scope is entered
with which contains a variable of variably modified type). This is
certainly an odd requirement.
It would be an odd requirement, and I don't see such a requirement in
the standard. C11 section 6.8.2 says that a compound statement { ... }
is a block, and section 6.2.4 paragraph 6 says that an auto object's
lifetime is from block entry until execution of that block ends in any
way. In this case, the block's execution ends each time through the
loop, so the variables in question do not survive from one loop
iteration to the next.