https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118

Yuri Gribov <tetra2005 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tetra2005 at gmail dot com

--- Comment #6 from Yuri Gribov <tetra2005 at gmail dot com> ---
Hm, isn't this a valid warning about bad code in pthread.h? As can be see in
https://github.com/gcc-mirror/gcc/blob/67b5f619e75b3085374598d6f0626ec00d4c9de6/gcc/function.c#L4389
, the warning is issued for variables which are alive after return from longjmp
but not marked as volatile. Such variables will have undefined value according
to C standard (http://pubs.opengroup.org/onlinepubs/7908799/xsh/longjmp.html).

Namely in this case, __cancel_arg and __cancel_routine are used after longjmp
(it's the case of __not_first_call != 0) and are not marked volatile so their
values are effectively undefined. I checked that adding volatile to them
supresses warnings.

Reply via email to