Re: gl_linked_iterator doesn't initialize all fields.

2024-05-11 Thread Collin Funk
Hi Bruno, Thanks for the explanations. On 5/11/24 6:06 AM, Bruno Haible wrote: >> But my instinct tells me these initializations should be done >> unconditionally so undefined behavior is avoided. > > There is no undefined behaviour here, only a false alarm. My thinking was that if iterator.coun

Re: gl_linked_iterator doesn't initialize all fields.

2024-05-11 Thread Bruno Haible
Hi Collin, > Here is the function that it is warning about: > > static gl_list_iterator_t _GL_ATTRIBUTE_PURE > gl_linked_iterator (gl_list_t list) > { > gl_list_iterator_t result; > > result.vtable = list->base.vtable; > result.list = list; > result.p = list->root.next; > result.q = &l