Cygwin: suppress a warning generated with w32api >= 12.0.0

w32api 12.0.0 adds the returns_twice attribute to RtlCaptureContext().
There's some data-flow interaction with using it inside a while loop
which causes a maybe-uninitialized warning.

../../../../winsup/cygwin/exceptions.cc: In member function 'int _cygtls::call_signal_handler()':
../../../../winsup/cygwin/exceptions.cc:1720:33: error: '<anonymous>' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This commit is contained in:
Jon Turney 2024-06-07 17:29:10 +01:00
parent 1ed1516136
commit 7e3c833592
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
1 changed files with 3 additions and 0 deletions

View File

@ -1717,7 +1717,10 @@ _cygtls::call_signal_handler ()
context, unwind to the caller and in case we're called context, unwind to the caller and in case we're called
from sigdelayed, fix the instruction pointer accordingly. */ from sigdelayed, fix the instruction pointer accordingly. */
context.uc_mcontext.ctxflags = CONTEXT_FULL; context.uc_mcontext.ctxflags = CONTEXT_FULL;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
RtlCaptureContext ((PCONTEXT) &context.uc_mcontext); RtlCaptureContext ((PCONTEXT) &context.uc_mcontext);
#pragma GCC diagnostic pop
__unwind_single_frame ((PCONTEXT) &context.uc_mcontext); __unwind_single_frame ((PCONTEXT) &context.uc_mcontext);
if (stackptr > stack) if (stackptr > stack)
{ {