Skip to content

Commit

Permalink
Cygwin: suppress a warning generated with w32api >= 12.0.0
Browse files Browse the repository at this point in the history
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]

Backported-from: 7e3c833592 (Cygwin: suppress a warning generated with w32api >= 12.0.0, 2024-06-07)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jul 8, 2024
1 parent 87d5722 commit 4b3a2e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions winsup/cygwin/exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,10 @@ _cygtls::call_signal_handler ()
context, unwind to the caller and in case we're called
from sigdelayed, fix the instruction pointer accordingly. */
context.uc_mcontext.ctxflags = CONTEXT_FULL;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
RtlCaptureContext ((PCONTEXT) &context.uc_mcontext);
#pragma GCC diagnostic pop
__unwind_single_frame ((PCONTEXT) &context.uc_mcontext);
if (stackptr > stack)
{
Expand Down

0 comments on commit 4b3a2e0

Please sign in to comment.