Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-19 Thread Arnaud Charlet
> > > > Does this warning make sense if !(lang_GNU_C() || lang_GNU_CXX()) ? > > > > > > I don't think so, it's meant for C/C++ only. I added a better check. > > > > Well, maybe the warning could also work for ObjC and ObjC++, but since I > > haven't included any testcases for these languages so

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-19 Thread Marek Polacek
On Thu, Aug 18, 2016 at 01:07:26PM -0400, David Malcolm wrote: > On Thu, 2016-08-18 at 15:50 +0200, Marek Polacek wrote: > > Now that all various switch fallthrough bugfixes and adjustments were > > committed, and this patch has shrunk considerably, I'm presenting the > > latest > > version. The c

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-19 Thread Jakub Jelinek
On Fri, Aug 19, 2016 at 02:01:29PM +0200, Marek Polacek wrote: > On Fri, Aug 19, 2016 at 01:21:14PM +0200, Marek Polacek wrote: > > On Thu, Aug 18, 2016 at 07:31:12PM +0100, Manuel López-Ibáñez wrote: > > > Does this warning make sense if !(lang_GNU_C() || lang_GNU_CXX()) ? > > > > I don't think s

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-19 Thread Marek Polacek
On Fri, Aug 19, 2016 at 01:21:14PM +0200, Marek Polacek wrote: > On Thu, Aug 18, 2016 at 07:31:12PM +0100, Manuel López-Ibáñez wrote: > > Does this warning make sense if !(lang_GNU_C() || lang_GNU_CXX()) ? > > I don't think so, it's meant for C/C++ only. I added a better check. Well, maybe the w

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-19 Thread Marek Polacek
On Thu, Aug 18, 2016 at 04:01:42PM +0200, Jakub Jelinek wrote: > On Thu, Aug 18, 2016 at 03:50:07PM +0200, Marek Polacek wrote: > > +case GIMPLE_BIND: > > + { > > + gbind *bind = as_a (stmt); > > + return last_stmt_in_scope ( > > +gimple_seq_last_stmt (gimple_bind_body (bi

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-19 Thread Marek Polacek
On Thu, Aug 18, 2016 at 07:31:12PM +0100, Manuel López-Ibáñez wrote: > Does this warning make sense if !(lang_GNU_C() || lang_GNU_CXX()) ? I don't think so, it's meant for C/C++ only. I added a better check. Thanks, Marek

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-18 Thread Manuel López-Ibáñez
On 18/08/16 18:07, David Malcolm wrote: This isn't quite the way that fix-its are meant to be used, in my mind, at least: the insertion text is supposed to be something that could be literally inserted into the code (e.g. by an IDE) i.e. it should be a code fragment, rather than a message to the

Re: Implement -Wimplicit-fallthrough (take 3): add gcc_fallthrough

2016-08-18 Thread Marek Polacek
On Thu, Aug 18, 2016 at 12:28:18PM -0500, Segher Boessenkool wrote: > On Thu, Aug 18, 2016 at 03:59:32PM +0200, Marek Polacek wrote: > > * eload1.c (elimination_effects): Likewise. > > So we are deleting reload one char at a time now? :-) If only! ;) I fixed the typo in my local copy, than

Re: Implement -Wimplicit-fallthrough (take 3): add gcc_fallthrough

2016-08-18 Thread Segher Boessenkool
On Thu, Aug 18, 2016 at 03:59:32PM +0200, Marek Polacek wrote: > * eload1.c (elimination_effects): Likewise. So we are deleting reload one char at a time now? :-) Segher

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-18 Thread David Malcolm
On Thu, 2016-08-18 at 15:50 +0200, Marek Polacek wrote: > Now that all various switch fallthrough bugfixes and adjustments were > committed, and this patch has shrunk considerably, I'm presenting the > latest > version. The changes from the last version are not huge; we don't > warn for a > fall t

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-18 Thread Jakub Jelinek
On Thu, Aug 18, 2016 at 03:50:07PM +0200, Marek Polacek wrote: > +case GIMPLE_BIND: > + { > + gbind *bind = as_a (stmt); > + return last_stmt_in_scope ( > + gimple_seq_last_stmt (gimple_bind_body (bind))); > + } > + > +case GIMPLE_TRY: > + { > + gtry