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
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
When compiling with -fanalyzer and including gl_anylinked_list2.h I
see this:
In file included from gl_linked_list.c:29:
gl_anylinked_list2.h: In function 'gl_linked_iterator':
gl_anylinked_list2.h:952:10: warning: use of uninitialized value 'result.count'
[CWE-457] [-Wanalyzer-use-of-uninitializ