Re: Add "-Wimplicit-fallthrough" to default flags (was Re: pgsql: Support FETCH FIRST WITH TIES)
Julien Rouhaud <rjuju123@gmail.com>
From: Julien Rouhaud <rjuju123@gmail.com>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, "pgsql-hackers@postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2020-04-12T15:42:28Z
Lists: pgsql-hackers
Attachments
- v2-implicit-fallthrough.diff (text/x-patch) patch v2
On Sun, Apr 12, 2020 at 5:25 PM Mark Dilger <mark.dilger@enterprisedb.com> wrote: > > > On Apr 12, 2020, at 7:55 AM, Tom Lane <tgl@sss.pgh.pa.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.
Commits
-
Dial back -Wimplicit-fallthrough to level 3
- 17cc133f017c 13.0 landed
-
Add -Wimplicit-fallthrough to CFLAGS and CXXFLAGS
- 3e9744465dbe 13.0 landed
-
Suppress -Wimplicit-fallthrough warning in new LIMIT WITH TIES code.
- 35cb574aa847 13.0 landed
-
Support FETCH FIRST WITH TIES
- 357889eb17bb 13.0 cited