rhboot / efibootmgr

efibootmgr development tree
GNU General Public License v2.0
514 stars 97 forks source link

gcc-9.2.0: error: pointer targets in passing argument 1 of 'efidp_format_device_path' differ in signedness #118

Closed MilhouseVH closed 3 years ago

MilhouseVH commented 5 years ago

Testing with d9eb7f1536ed6262fc8c6518c6afe6053a450e9d and glibc-2.30, building for x86_64 with kernel 5.2.8:

/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc   -march=x86-64 -m64 -mmmx -msse -msse2 -mfpmath=sse -fomit-frame-pointer -Wall -pipe  -O2 -I/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -I/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/efivar -fgnu89-inline -I/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/efibootmgr-d9eb7f1536ed6262fc8c6518c6afe6053a450e9d/src/include -Werror -Wall -Wextra -Wsign-compare -Wstrict-aliasing -std=gnu11 -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale/\" -DEFIBOOTMGR_VERSION="\"17\"" -DDEFAULT_LOADER=\"\\\\EFI\\\\BOOT\\\\bootx64.efi\"     -c -o unparse_path.o unparse_path.c
efibootmgr.c: In function 'show_var_path':
efibootmgr.c:937:32: error: pointer targets in passing argument 1 of 'efidp_format_device_path' differ in signedness [-Werror=pointer-sign]
  937 |  rc = efidp_format_device_path(text_path, text_path_len,
      |                                ^~~~~~~~~
      |                                |
      |                                char *
In file included from /home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/efivar/efivar.h:258,
                 from efibootmgr.c:49:
/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/efivar/efivar-dp.h:1247:56: note: expected 'unsigned char *' but argument is of type 'char *'
 1247 | extern ssize_t efidp_format_device_path(unsigned char *buf, size_t size,
      |                                         ~~~~~~~~~~~~~~~^~~
efibootmgr.c:952:32: error: pointer targets in passing argument 1 of 'efidp_format_device_path' differ in signedness [-Werror=pointer-sign]
  952 |  rc = efidp_format_device_path(text_path, text_path_len,
      |                                ^~~~~~~~~
      |                                |
      |                                char *
In file included from /home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/efivar/efivar.h:258,
                 from efibootmgr.c:49:
/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/efivar/efivar-dp.h:1247:56: note: expected 'unsigned char *' but argument is of type 'char *'
 1247 | extern ssize_t efidp_format_device_path(unsigned char *buf, size_t size,
      |                                         ~~~~~~~~~~~~~~~^~~
cc1: all warnings being treated as errors
make[1]: *** [/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/efibootmgr-d9eb7f1536ed6262fc8c6518c6afe6053a450e9d/Make.rules:32: efibootmgr.o] Error 1
make[1]: Leaving directory '/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.80-devel/efibootmgr-d9eb7f1536ed6262fc8c6518c6afe6053a450e9d/src'
make: *** [Makefile:24: efibootmgr] Error 2

Full log: http://ix.io/1RHJ

vathpela commented 4 years ago

I think this should be fixed with the current https://github.com/rhboot/efivar and efibootmgr master branches?

martinezjavier commented 3 years ago

Yes, efidp_format_device_path() now has unsigned char * for its first parameter, so this should be fixed by newer efivar as mentioned by @vathpela. I'm closing this since in any case is not an efibootmgr issue.