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

Andy Fan <zhihui.fan1213@gmail.com>

From: Andy Fan <zhihui.fan1213@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Julien Rouhaud <rjuju123@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-05-15T00:24:23Z
Lists: pgsql-hackers
On Wed, May 13, 2020 at 10:02 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Andy Fan <zhihui.fan1213@gmail.com> writes:
> >> FWIW, I got a warning for jsonpath_gram.c.
>
> Ugh.  Confirmed here on Fedora 30 (bison 3.0.5).
>
> > 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.
>
> I fear that is going to mean that we revert this patch.
> We are *NOT* moving the minimum bison requirement for this,
> especially not to a bleeding-edge bison version.


Yes,  I didn't mean revert the patch, but I was thinking moving the minimum
bison.  But since down to the warning level 3 also resolved the issue,
looks it is a better way to do it.

  (On the other hand, if you have an old bison,
>
you likely also have an old gcc that doesn't know this warning
> switch, so maybe it'd be all right in practice?)
>
>
I just use an old bision and a newer gcc:(  and I used "echo "COPT=-Wall
-Werror"
> src/Makefile.custom" which is same as our cfbot system.  Thank you all
for so quick
fix!

Best Regards
Andy Fan

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