Re: Add "-Wimplicit-fallthrough" to default flags (was Re: pgsql: Support FETCH FIRST WITH TIES)

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add "-Wimplicit-fallthrough" to default flags (was Re: pgsql: Support FETCH FIRST WITH TIES)
Date: 2020-04-12 15:42:28
Message-ID: CAOBaU_Zx6+2eD7G1QYRy3nvHkSn=5m-KD6MRysqmWKqRd1gbUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sun, Apr 12, 2020 at 5:25 PM Mark Dilger
<mark(dot)dilger(at)enterprisedb(dot)com> wrote:
>
> > On Apr 12, 2020, at 7:55 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Poking around in the archives, it seems like the only previous formal
> > proposal to add -Wimplicit-fallthrough was in the context of a much
> > more aggressive proposal to make a lot of non-Wall warnings into
> > errors [1], which people did not like.
>
> That was from me.
>
> > The only more-restrictive alternative, short of disabling
> > the comments altogether, is
> >
> > * -Wimplicit-fallthrough=4 case sensitively matches one of the
> > following regular expressions:
> >
> > *<"-fallthrough">
> > *<"@fallthrough@">
> > *<"lint -fallthrough[ \t]*">
> > *<"[ \t]*FALLTHR(OUGH|U)[ \t]*">
> >
> > Thoughts?
>
> Naturally, I'm +1 for this.

+1 too, obviously.

Attachment Content-Type Size
v2-implicit-fallthrough.diff text/x-patch 3.9 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2020-04-12 16:05:48 pgsql: Rename pg_validatebackup to pg_verifybackup.
Previous Message Mark Dilger 2020-04-12 15:25:21 Re: Add "-Wimplicit-fallthrough" to default flags (was Re: pgsql: Support FETCH FIRST WITH TIES)

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-04-12 18:24:52 Re: execExprInterp() questions / How to improve scalar array op expr eval?
Previous Message Magnus Hagander 2020-04-12 15:29:55 Re: pg_validatebackup -> pg_verifybackup?