Re: [C PATCH] field_decl_cmp

2017-09-15 Thread Joseph Myers
On Fri, 15 Sep 2017, Nathan Sidwell wrote: > On 09/12/2017 12:48 PM, Joseph Myers wrote: > > > I'd be concerned about the possibility of a qsort implementation that > > calls the comparison function with two pointers to the same object (as far > > as I can tell, it's valid for qsort to do that).

Re: [C PATCH] field_decl_cmp

2017-09-15 Thread Nathan Sidwell
On 09/12/2017 12:48 PM, Joseph Myers wrote: I'd be concerned about the possibility of a qsort implementation that calls the comparison function with two pointers to the same object (as far as I can tell, it's valid for qsort to do that). That is, I think you need to check for the two DECLs bein

Re: [C PATCH] field_decl_cmp

2017-09-12 Thread Joseph Myers
On Tue, 12 Sep 2017, Nathan Sidwell wrote: > On 09/12/2017 12:06 PM, Joseph Myers wrote: > > On Tue, 12 Sep 2017, Nathan Sidwell wrote: > > > > This patch removes that checking, and also asserts that when we see > > > identically named decls, exactly one is a TYPE_DECL. > > > > When do you get T

Re: [C PATCH] field_decl_cmp

2017-09-12 Thread Nathan Sidwell
On 09/12/2017 12:06 PM, Joseph Myers wrote: On Tue, 12 Sep 2017, Nathan Sidwell wrote: This patch removes that checking, and also asserts that when we see identically named decls, exactly one is a TYPE_DECL. When do you get TYPE_DECLs here, for C? I wouldn't expect them to be possible. o

Re: [C PATCH] field_decl_cmp

2017-09-12 Thread Joseph Myers
On Tue, 12 Sep 2017, Nathan Sidwell wrote: > Joseph, > in moving field_decl_cmp to the C FE, I noticed it checks for NULL DECL_NAMES. > Those don't occur. To be clear: they don't occur in the case where field_decl_cmp is used; they can occur in other cases. > This patch removes that checking, a

[C PATCH] field_decl_cmp

2017-09-12 Thread Nathan Sidwell
Joseph, in moving field_decl_cmp to the C FE, I noticed it checks for NULL DECL_NAMES. Those don't occur. This patch removes that checking, and also asserts that when we see identically named decls, exactly one is a TYPE_DECL. ok? nathan -- Nathan Sidwell 2017-09-12 Nathan Sidwell * c