All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] clang: disable the gcc-compat warnings for read_atomic
Date: Tue, 11 Apr 2017 09:46:17 +0100	[thread overview]
Message-ID: <20170411084617.i7na5o3zfrrvlxsq@dhcp-3-128.uk.xensource.com> (raw)
In-Reply-To: <58ECB18F020000780014FB98@prv-mh.provo.novell.com>

On Tue, Apr 11, 2017 at 02:35:59AM -0600, Jan Beulich wrote:
> >>> On 11.04.17 at 09:54, <roger.pau@citrix.com> wrote:
> > clang gcc-compat warnings can wrongly fire when certain constructions are used,
> > at least the following flow:
> > 
> > switch ( ... )
> > {
> > case ...:
> >     while ( ({ int x; switch ( foo ) { case 1: x = 1; break; } x }) )
                                                                    ^ missing ;
> >     {
> >         ...
> > 
> > Will cause clang to emit the following warning "'break' is bound to loop, GCC
> > binds it to switch", which is a false positive, and both gcc and clang bound
> 
> bind (I think)

Right, I think so.

> 
> > the break to the inner switch. In order to workaround this issue, disable the
> > gcc-compat checks for the usage of the read_atomic macro.
> 
> Hmm, so far it wasn't clear to me that this is also needing an outer
> switch() - can you confirm switch inside the while control expression
> alone does not trigger the warning?

Yes, I can confirm that the following:

while ( ({ int x; switch ( foo ) { case 1: x = 1; break; } x; }) )
{
    ...

Does not trigger the warning.

> > This has been reported upstream as 
> > http://bugs.llvm.org/show_bug.cgi?id=32595.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> The patch itself is fine with me, i.e.
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> but besides wanting to wait for above confirmation, I'd also like
> to allow some time for others to voice objections to this new
> approach.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-04-11  8:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  7:54 [PATCH] clang: disable the gcc-compat warnings for read_atomic Roger Pau Monne
2017-04-11  8:35 ` Jan Beulich
2017-04-11  8:46   ` Roger Pau Monne [this message]
2017-04-13 15:11 ` Jan Beulich
2017-04-13 15:23   ` Julien Grall
2017-08-01  7:04 ` Roger Pau Monne

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=20170411084617.i7na5o3zfrrvlxsq@dhcp-3-128.uk.xensource.com \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.