public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Joshua Watt <jpewhacker@gmail.com>
To: Mark Wielaard <mark@klomp.org>, Ulf Hermann <ulf.hermann@qt.io>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH v2] Add fallthrough attributes
Date: Fri, 09 Feb 2018 14:19:00 -0000	[thread overview]
Message-ID: <1518185959.3509.34.camel@gmail.com> (raw)
In-Reply-To: <20180209092655.GB3320@wildebeest.org>

On Fri, 2018-02-09 at 10:26 +0100, Mark Wielaard wrote:
> On Fri, Feb 09, 2018 at 10:08:09AM +0100, Ulf Hermann wrote:
> > > [...]
> > > +#ifdef HAVE_FALLTHROUGH
> > > +      __attribute__ ((fallthrough));
> > > +#endif
> > > [...]
> > 
> > I would like to see this stanza wrapped in a macro, so that we only
> > have one "#ifdef HAVE_FALLTHROUGH" in the code, not another one in
> > every place we want to fall through. See the "internal_function"
> > macro defined in lib/eu-config.h for a similar case.
> 
> Agreed. Having 4 lines for a fallthrough instead of 1 is really too
> much. Also could you explain a bit more why you would like this?
> The advantage of the comments really is that they should work
> everywhere.

I'm attempting to build Yocto using Icecream to do distributed
compiling. Icecream pre-processes the file before sending it to the
remote compiling node, thus removing the comments and triggering the
error.

There is a fix in Icecream to allow it to not remove comments when pre-
processing, but it will be a while before that change (which hasn't
been released yet) trickles down to all the end Icecream users. I
figured making the change here wouldn't hurt in the meantime.

> 
> If the comment really doesn't work in your situation maybe we could
> do
> like gnulib did:
> http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=11fdf80b21f2b4
> 0a10687b9a3d16c852b19d512c
> 
> The idea is that those versions of GCC that support
> -Wimplicit-fallthrough also have support for the __attribute__
> ((fallthrough)) statement. So they can always be used together.

Yes, that is cleaner and makes more sense. I will change my patch to do
that.

Thanks,
Joshua Watt

> 
> Cheers,
> 
> Mark

  reply	other threads:[~2018-02-09 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 22:57 [PATCH] " Joshua Watt
2018-02-08 23:30 ` [PATCH v2] " Joshua Watt
2018-02-09  9:08   ` Ulf Hermann
2018-02-09  9:27     ` Mark Wielaard
2018-02-09 14:19       ` Joshua Watt [this message]
2018-02-09 16:27   ` [PATCH v3] Use fallthrough attribute Joshua Watt
2018-02-10  2:26     ` Mark Wielaard
2018-02-10  3:36       ` Frank Ch. Eigler
2018-02-10 12:39         ` ChangeLog entries (Was: [PATCH v3] Use fallthrough attribute) Mark Wielaard
2018-02-12  9:34           ` Ulf Hermann

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=1518185959.3509.34.camel@gmail.com \
    --to=jpewhacker@gmail.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.org \
    --cc=ulf.hermann@qt.io \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).