From: Segher Boessenkool <segher@kernel.crashing.org>
To: christophe leroy <christophe.leroy@c-s.fr>
Cc: Mathieu Malaterre <malat@debian.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Yisheng Xie <xieyisheng1@huawei.com>,
Vaibhav Jain <vaibhav@linux.vnet.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
Breno Leitao <leitao@debian.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/xmon: avoid warnings about variables that might be clobbered by ‘longjmp’
Date: Sat, 23 Jun 2018 14:47:16 -0500 [thread overview]
Message-ID: <20180623194716.GY16221@gate.crashing.org> (raw)
In-Reply-To: <b41b244e-78b8-c85f-9122-427ad04cccf8@c-s.fr>
On Sat, Jun 23, 2018 at 06:59:27PM +0200, christophe leroy wrote:
>
>
> Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit :
> >Move initialization of variables after data definitions. This silence
> >warnings treated as error with W=1:
> >
> > arch/powerpc/xmon/xmon.c:3389:14: error: variable ‘name’ might be
> > clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
> > arch/powerpc/xmon/xmon.c:3100:22: error: variable ‘tsk’ might be
> > clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
>
> Is that an invalid warning ?
No, both are correct warnings. GCC can not see which functions it only
has a declaration of can call longjmp.
> Otherwise, I'd expect one to fix the warning, not just cheat on GCC.
Yes, the patch seems to change the code in such a way that some versions
of GCC will no longer warn. Which does not make to code any more correct.
Either restructure the code, or make the var non-automatic, or make it
volatile.
Segher
next prev parent reply other threads:[~2018-06-23 19:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 19:27 [PATCH] powerpc/xmon: avoid warnings about variables that might be clobbered by ‘longjmp’ Mathieu Malaterre
2018-06-23 16:59 ` christophe leroy
2018-06-23 19:47 ` Segher Boessenkool [this message]
2018-06-26 6:27 ` Mathieu Malaterre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180623194716.GY16221@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=malat@debian.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=paulus@samba.org \
--cc=vaibhav@linux.vnet.ibm.com \
--cc=xieyisheng1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).