Re: Add "-Wimplicit-fallthrough" to default flags

Julien Rouhaud <rjuju123@gmail.com>

From: Julien Rouhaud <rjuju123@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Andy Fan <zhihui.fan1213@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Álvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-05-13T11:35:18Z
Lists: pgsql-hackers
On Wed, May 13, 2020 at 12:16 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Wed, 13 May 2020 16:17:50 +0800, Andy Fan <zhihui.fan1213@gmail.com> wrote in
> > On Wed, May 13, 2020 at 4:13 PM Kyotaro Horiguchi <horikyota.ntt@gmail.com>
> > wrote:
> > > > jsonpath_gram.c:1026:16: warning: this statement may fall through
> > > [-Wimplicit-fallthrough=]
> > > >              if (*++yyp != '\\')
> > > >                 ^
> > > > jsonpath_gram.c:1029:11: note: here
> > > >            default:
> ...
> > > It is generated code by bison.
> > >
> > > $ bison --version
> > > bison (GNU Bison) 3.0.4
> > >
> > >
> > I just found this just serval minutes ago.  Upgrading your bison to the
> > latest
> > version (3.6) is ok. I'd like we have a better way to share this knowledge
> > through.
> > I spend ~30 minutes to troubleshooting this issue.
>
> Thanks. I'm happy to know that! But AFAICS 3.0.4 is the current
> version of bison in AppStream and PowerTools of CentOS8...

FTR I'm using bison 3.5 and I didn't hit any issue.  However that may
be because of ccache, as mentioned by Alvaro.



Commits

  1. Dial back -Wimplicit-fallthrough to level 3

  2. Add -Wimplicit-fallthrough to CFLAGS and CXXFLAGS

  3. Suppress -Wimplicit-fallthrough warning in new LIMIT WITH TIES code.

  4. Support FETCH FIRST WITH TIES