Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-13 Thread Marek Polacek
On Fri, Nov 13, 2015 at 04:56:30PM +0100, Jakub Jelinek wrote: > On Fri, Nov 13, 2015 at 04:53:05PM +0100, Marek Polacek wrote: > > On Fri, Nov 13, 2015 at 04:44:21PM +0100, Bernd Schmidt wrote: > > > I don't think so, the three codes are adjacent so we should be generating > > > "(unsigned)(code -

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-13 Thread Marek Polacek
On Fri, Nov 13, 2015 at 04:44:21PM +0100, Bernd Schmidt wrote: > On 11/13/2015 04:11 PM, Marek Polacek wrote: > >Sorry, I changed my mind. Since QUAL_UNION_TYPE is Ada-only thing and > >we check (RECORD_TYPE || UNION_TYPE) in a lot of places in the C FE, > >introducing RECORD_OR_UNION_TYPE_P every

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-13 Thread Jakub Jelinek
On Fri, Nov 13, 2015 at 04:53:05PM +0100, Marek Polacek wrote: > On Fri, Nov 13, 2015 at 04:44:21PM +0100, Bernd Schmidt wrote: > > On 11/13/2015 04:11 PM, Marek Polacek wrote: > > >Sorry, I changed my mind. Since QUAL_UNION_TYPE is Ada-only thing and > > >we check (RECORD_TYPE || UNION_TYPE) in a

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-13 Thread Bernd Schmidt
On 11/13/2015 04:11 PM, Marek Polacek wrote: Sorry, I changed my mind. Since QUAL_UNION_TYPE is Ada-only thing and we check (RECORD_TYPE || UNION_TYPE) in a lot of places in the C FE, introducing RECORD_OR_UNION_TYPE_P everywhere would unnecessarily slow things down. I don't think so, the thre

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-13 Thread Marek Polacek
On Fri, Nov 13, 2015 at 07:16:08AM -0500, David Malcolm wrote: > > > + && (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE > > > + || TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)) > > > > This is RECORD_OR_UNION_TYPE_P (TREE_TYPE (field)). > > I based this code on the code in lookup_field ri

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-13 Thread David Malcolm
On Fri, 2015-11-13 at 07:57 +0100, Marek Polacek wrote: > Probably coming too late, sorry. > On Thu, Nov 12, 2015 at 09:08:36PM -0500, David Malcolm wrote: > > index 4335a87..eb4e1fc 100644 > > --- a/gcc/c/c-typeck.c > > +++ b/gcc/c/c-typeck.c > > @@ -47,6 +47,7 @@ along with GCC; see the file COP

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-12 Thread Marek Polacek
Probably coming too late, sorry. On Thu, Nov 12, 2015 at 09:08:36PM -0500, David Malcolm wrote: > index 4335a87..eb4e1fc 100644 > --- a/gcc/c/c-typeck.c > +++ b/gcc/c/c-typeck.c > @@ -47,6 +47,7 @@ along with GCC; see the file COPYING3. If not see > #include "c-family/c-ubsan.h" > #include "cil

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-12 Thread David Malcolm
On Sun, 2015-11-01 at 23:44 -0700, Jeff Law wrote: > On 10/30/2015 06:47 AM, David Malcolm wrote: > > > The typename suggestion seems to be at least somewhat controversial, > > whereas (I hope) the misspelled field names suggestion is more > > acceptable. > > > > Hence I'm focusing on the field na

Re: [PATCH 0/2] Levenshtein-based suggestions (v3)

2015-11-01 Thread Jeff Law
On 10/30/2015 06:47 AM, David Malcolm wrote: The typename suggestion seems to be at least somewhat controversial, whereas (I hope) the misspelled field names suggestion is more acceptable. Hence I'm focusing on the field name lookup for now; other uses of the algorithm (e.g. the typename lookup