Re: Add "-Wimplicit-fallthrough" to default flags - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add "-Wimplicit-fallthrough" to default flags
Date
Msg-id 31166.1589378554@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add "-Wimplicit-fallthrough" to default flags  (Andy Fan <zhihui.fan1213@gmail.com>)
Responses Re: Add "-Wimplicit-fallthrough" to default flags  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Add "-Wimplicit-fallthrough" to default flags  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers
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.

Alternatively, it might work to go back down to warning level 3;
I see that the code in question has

    /* Fall through.  */

which I believe would work at the lower warning level.  But that
raises the question of how far back bison generates code that
is clean --- and, again, I'm not willing to move the minimum
bison requirement.  (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?)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: COPY, lock release and MVCC
Next
From: Tom Lane
Date:
Subject: Re: PG compilation error with Visual Studio 2015/2017/2019