[PATCH] pthread_cleanup_push macro generates warning when -Wclobbered is set

Paul Eggert eggert@cs.ucla.edu
Tue Nov 21 22:28:00 GMT 2017


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.



More information about the Libc-alpha mailing list