If boot_order_size is 0, i was never set. On gcc-6.3.1, this broke the
build if compiled with -O2 (-Werror=maybe_uninitialized). This is the
error:
libfwup.c: In function 'set_up_boot_next':
libfwup.c:818:16: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized]
new_boot_order[i] = boot_entry;
^
libfwup.c:780:15: note: 'i' was declared here
unsigned int i;
^
cc1: all warnings being treated as errors
If boot_order_size is 0, i was never set. On gcc-6.3.1, this broke the build if compiled with -O2 (-Werror=maybe_uninitialized). This is the error:
libfwup.c: In function 'set_up_boot_next': libfwup.c:818:16: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized] new_boot_order[i] = boot_entry; ^ libfwup.c:780:15: note: 'i' was declared here unsigned int i; ^ cc1: all warnings being treated as errors