[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FALLTHROUGH warning in quotearg.c with gcc-7.1
From: |
Jim Meyering |
Subject: |
Re: FALLTHROUGH warning in quotearg.c with gcc-7.1 |
Date: |
Thu, 25 May 2017 17:44:59 -0700 |
On Thu, May 25, 2017 at 5:10 PM, Assaf Gordon <address@hidden> wrote:
> Hello,
>
> Pulling the latest gnulib and compling with gcc-7.1,
> I'm seeing the following warning:
> ====
> gcc-7.1 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -Ilib
> -I./lib -Isrc -I./src -g -O2 -MT lib/quotearg.o -MD -MP -MF $depbase.Tpo
> -c -o lib/quotearg.o lib/quotearg.c &&\
> mv -f $depbase.Tpo $depbase.Po
> lib/quotearg.c: In function 'quotearg_buffer_restyled':
> lib/quotearg.c:61:23: warning: attribute 'fallthrough' not preceding a case
> label or default label
> # define FALLTHROUGH __attribute__ ((__fallthrough__))
> ^
> lib/quotearg.c:516:11: note: in expansion of macro 'FALLTHROUGH'
> FALLTHROUGH;
> ^~~~~~~~~~~
> ====
>
>> From a cursory check, it is not due to the recent commits:
>
> 949b6cc fallthrough: reinstate a FALLTHROUGH instance in quotearg
> 11fdf80 fallthrough: update for GCC 7/8
> The warning appears even if I use an older revision of gnulib.
>
> I haven't yet tried to investigate further,
> but note this is with 'gnu datamash', not 'coreutils' - it's
> possible there's a project-specific problem, not gnulib problem.
Thanks for the heads up. It is due to 949b6cc, whose one-line summary
is misleading. That commit did not reinstate a use of the macro. The
macro works only just before a case statement. Instead of a use of the
macro, it should be a mere comment, like it was before.