Re: [PATCH] Cygwin: Suppress a warning generated with w32api >= 12.0.0
On 08/06/2024 17:43, Takashi Yano wrote: On Fri, 7 Jun 2024 17:37:24 +0100 Jon Turney wrote: 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: '' may be used uninitialized in this function [-Werror=maybe-uninitialized] │ [...] It seems that the commit message include non UTF-8 chars. Thanks for pointing that out. Hopefully, I fixed it before applying.
Re: [PATCH] Cygwin: Suppress a warning generated with w32api >= 12.0.0
On Fri, 7 Jun 2024 17:37:24 +0100 Jon Turney wrote: > 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: '' may be > used uninitialized in this function [-Werror=maybe-uninitialized] > │ > --- > winsup/cygwin/exceptions.cc | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc > index a2a6f9d4c..28d0431d5 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) _mcontext); > +#pragma GCC diagnostic pop > __unwind_single_frame ((PCONTEXT) _mcontext); > if (stackptr > stack) > { > -- > 2.45.1 It seems that the commit message include non UTF-8 chars. -- Takashi Yano
[PATCH] 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: '' may be used uninitialized in this function [-Werror=maybe-uninitialized] │ --- winsup/cygwin/exceptions.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index a2a6f9d4c..28d0431d5 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) _mcontext); +#pragma GCC diagnostic pop __unwind_single_frame ((PCONTEXT) _mcontext); if (stackptr > stack) { -- 2.45.1