From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110823 invoked by alias); 9 Feb 2018 09:27:36 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 110622 invoked by uid 89); 9 Feb 2018 09:27:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy= X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Feb 2018 09:26:58 +0000 Received: from librem.wildebeest.org (deer0x01.wildebeest.org [172.31.17.131]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id F18ED310B6E5; Fri, 9 Feb 2018 10:26:55 +0100 (CET) Received: by librem.wildebeest.org (Postfix, from userid 1000) id A09E21407EC; Fri, 9 Feb 2018 10:26:55 +0100 (CET) Date: Fri, 09 Feb 2018 09:27:00 -0000 From: Mark Wielaard To: Ulf Hermann Cc: elfutils-devel@sourceware.org, jpewhacker@gmail.com Subject: Re: [PATCH v2] Add fallthrough attributes Message-ID: <20180209092655.GB3320@wildebeest.org> References: <20180208225646.12036-1-JPEWhacker@gmail.com> <20180208233010.11395-1-JPEWhacker@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q1/txt/msg00025.txt.bz2 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. 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=11fdf80b21f2b40a10687b9a3d16c852b19d512c 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. Cheers, Mark