aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2024-06-07 17:29:10 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2024-06-16 15:33:14 +0100
commitd1670f1e963039d0f16cfc30abdcea118b65504e (patch)
treea39f49281e282b28550901b87cd166c112160d44
parent84dff09aa0d3ad998551e3f91c61dc0534b0b8bf (diff)
downloadnewlib-cygwin-3_5-branch.zip
newlib-cygwin-3_5-branch.tar.gz
newlib-cygwin-3_5-branch.tar.bz2
Cygwin: suppress a warning generated with w32api >= 12.0.0github/cygwin-3_5-branchcygwin-3_5-branch
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] (cherry picked from commit 7e3c833592b282355a57dd34459b152e4e078d19)
-rw-r--r--winsup/cygwin/exceptions.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index a2a6f9d..28d0431 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -1717,7 +1717,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)
{