lcp / mokutil

The utility to manipulate machine owner keys
GNU General Public License v3.0
60 stars 37 forks source link

Conflicting types for efi_char16_t #66

Closed hanmertens closed 1 year ago

hanmertens commented 1 year ago

When I try to compile mokutil (current master branch), it fails with the following message:

In file included from efi_hash.h:38,
                 from efi_hash.c:36:
mokutil.h:42:17: error: conflicting types for 'efi_char16_t'; have 'wchar_t' {aka 'int'}
   42 | typedef wchar_t efi_char16_t;           /* UNICODE character */
      |                 ^~~~~~~~~~~~
In file included from /usr/include/efivar/efivar.h:21,
                 from efi_hash.h:36:
/usr/include/efivar/efivar-types.h:50:18: note: previous declaration of 'efi_char16_t' with type 'efi_char16_t' {aka 'short unsigned int'}
   50 | typedef uint16_t efi_char16_t;
      |                  ^~~~~~~~~~~~
make[2]: *** [Makefile:415: mokutil-efi_hash.o] Error 1
make[1]: *** [Makefile:419: all-recursive] Error 1
make: *** [Makefile:339: all] Error 2

I think it might have to do with me using musl as my libc implementation, given this bug for mokutil 0.5.0, and that I can successfully compiled it on a glibc system. In any case, the issue is that the definition is different from the definition given by efivar 38. Simply deleting the line with the conflicting definition allows me to compile mokutil without errors.