intel_asm_annotation.c: In function ‘annotation_insert_error’:
intel_asm_annotation.c:214:18:
warning: ‘ann’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
ann->error = ralloc_strdup(annotation->mem_ctx, error);
^
I initially tried changing the type of ann_count to unsigned (is
currently int), since that in addition to the check that it's non-zero
at the beginning of the function seems sufficient to prove that it must
be greater than zero. Unfortunately that wasn't sufficient.
if (!annotation_array_ensure_space(annotation))
return;
+ assume(annotation->ann_count > 0);
+
for (int i = 0; i < annotation->ann_count; i++) {
struct annotation *cur = &annotation->ann[i];
struct annotation *next = &annotation->ann[i + 1];
break;
}
- assume(ann != NULL);
-
if (ann->error)
ralloc_strcat(&ann->error, error);
else