esl-iter.c:84:1: error: conflicting types for ‘esl_iter_next_with_size_correction’ due to enum/integer mismatch; have ‘esl_iter_status_t(esl_iter *, efi_guid_t *, efi_guid_t *, uint8_t **, size_t *, _Bool)’ {aka ‘enum esl_iter_status(esl_iter *, efi_guid_t *, efi_guid_t *, unsigned char **, long unsigned int *, _Bool)’} [-Werror=enum-int-mismatch]
...
esl-iter.h:61:12: note: previous declaration of ‘esl_iter_next_with_size_correction’ with type ‘int(esl_iter *, efi_guid_t *, efi_guid_t *, uint8_t **, size_t *, _Bool)’ {aka ‘int(esl_iter *, efi_guid_t *, efi_guid_t *, unsigned char **, long unsigned int *, _Bool)’}
is produced. This is due to C assuming int when no return type is specified. Granted it is an int type in the form of an enum which is why -Werror produces an error but there is no genuine issue in functionality or typing. We can just declare the return type to be the esl_iter_status_t enum explicitly in the source file and resolve this error alongside any other functions that will produce this error.
When using
-Werrorfor compiling this (as part of GUIX for RISC-V for context) the error:is produced. This is due to C assuming
intwhen no return type is specified. Granted it is an int type in the form of an enum which is why-Werrorproduces an error but there is no genuine issue in functionality or typing. We can just declare the return type to be theesl_iter_status_tenum explicitly in the source file and resolve this error alongside any other functions that will produce this error.