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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add "-Wimplicit-fallthrough" to default flags
Date: 2020-05-13 14:02:34
Message-ID: 31166.1589378554@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Andy Fan <zhihui(dot)fan1213(at)gmail(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2020-05-13 15:23:57 Re: Add "-Wimplicit-fallthrough" to default flags
Previous Message Fujii Masao 2020-05-13 13:21:08 pgsql: Use proper GetDatum function in pg_stat_get_slru().

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-05-13 14:04:51 Re: PG compilation error with Visual Studio 2015/2017/2019
Previous Message Amit Kapila 2020-05-13 13:59:14 Re: COPY, lock release and MVCC