This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Implement -Wimplicit-fallthrough (version 9)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Michael Matz <matz at suse dot de>, Bernd Schmidt <bschmidt at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, Eric Botcazou <ebotcazou at adacore dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Markus Trippelsdorf <markus at trippelsdorf dot de>, Rainer Orth <ro at cebitec dot uni-bielefeld dot de>, Joseph Myers <joseph at codesourcery dot com>, Arnaud Charlet <charlet at adacore dot com>
- Date: Tue, 27 Sep 2016 17:24:22 +0200
- Subject: Re: Implement -Wimplicit-fallthrough (version 9)
- Authentication-results: sourceware.org; auth=none
- References: <a84b88e9-d6bd-31f4-a33e-1104531d7a22@redhat.com> <20160927115153.GU3223@redhat.com> <8521f44d-616c-a03d-879d-c400b13ce9d9@redhat.com> <20160927120108.GV3223@redhat.com> <6b5dbab6-0b5a-3f55-53e0-5dc419a3cd6a@redhat.com> <20160927134914.GW7282@tucnak.redhat.com> <alpine.LSU.2.20.1609271553120.5714@wotan.suse.de> <CADzB+2nbTbV=XWPRPFK6CSgsZoAsUz+oostdvFnCAT=dG3hNfQ@mail.gmail.com> <20160927145428.GE3223@redhat.com> <20160927150423.GY7282@tucnak.redhat.com>
On Tue, Sep 27, 2016 at 05:04:23PM +0200, Jakub Jelinek wrote:
> On Tue, Sep 27, 2016 at 04:54:28PM +0200, Marek Polacek wrote:
> > On Tue, Sep 27, 2016 at 10:48:50AM -0400, Jason Merrill wrote:
> > > On Tue, Sep 27, 2016 at 9:56 AM, Michael Matz <matz@suse.de> wrote:
> > > > On Tue, 27 Sep 2016, Jakub Jelinek wrote:
> > > >
> > > >> Just compare that to the number of real bugs the warning found in gcc
> > > >> codebase. It is really worth it for -Wextra.
> > > >
> > > > All those bugs would also have been found as well when it had simply
> > > > accepted
> > > > /fall.*thr/i
> > > > anywhere in the preceding comment on one line. But all the recent
> > > > spelling changes of comments to cater for the strictness exactly shows how
> > > > misguided that is. The above would accept "Don't fall through" as well.
> > > > I say: so what?
> > >
> > > I agree.
> >
> > All right, I'm not opposed to making the comment parsing more benevolent.
> > We still should have enough time to fine-tune it.
>
> Perhaps we want -Wimplicit-fallthrough{,=1,=2,=3,=4}, where
> =1 would match indeed /fall.*thr/i (note, it will be really costly in this
> case, one will have to parse all comments in detail in the preprocessor,
> so I'd be against making it the default),
Perhaps we could use POSIX regcomp/regex functions; do you (or anyone else)
have an idea how expensive they are and if it's feasible to use them in the
preprocessor?
Marek