Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efivar 38: i686: off_t vs. ssize_t #209

Closed
itd0 opened this issue Feb 25, 2022 · 2 comments
Closed

efivar 38: i686: off_t vs. ssize_t #209

itd0 opened this issue Feb 25, 2022 · 2 comments

Comments

@itd0
Copy link
Contributor

itd0 commented Feb 25, 2022

Hi,

here efivar 38 produces following warnings on i686:

gcc -Og  -g3 -Wall -Wextra  -Werror  -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/gcc.specs -fno-merge-constants   -I/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/efivar -fPIC  -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/ -c -o thread-test.o thread-test.c
In file included from /tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/efivar/efisec.h:10,
                 from efisec.h:12,
                 from esl-iter.c:7:
esl-iter.c: In function ‘esl_list_iter_next_with_size_correction’:
/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/efivar/efivar.h:186:46: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 6 has type ‘off_t’ {aka ‘long int’} [-Werror=format=]
  186 |  efi_error_set(file, function, line, errval, (fmt), ## args)
      |                                              ^~~~~
/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/efivar/efivar.h:189:2: note: in expansion of macro ‘efi_error_real__’
  189 |  efi_error_real__(errno, __FILE__, __func__, __LINE__, (fmt), ## args)
      |  ^~~~~~~~~~~~~~~~
esl-iter.c:311:3: note: in expansion of macro ‘efi_error’
  311 |   efi_error("iter->offset (%zd) < 0", iter->offset);
      |   ^~~~~~~~~
/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/efivar/efivar.h:186:46: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 6 has type ‘off_t’ {aka ‘long int’} [-Werror=format=]
  186 |  efi_error_set(file, function, line, errval, (fmt), ## args)
      |                                              ^~~~~
/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/efivar/efivar.h:189:2: note: in expansion of macro ‘efi_error_real__’
  189 |  efi_error_real__(errno, __FILE__, __func__, __LINE__, (fmt), ## args)
      |  ^~~~~~~~~~~~~~~~
esl-iter.c:316:3: note: in expansion of macro ‘efi_error’
  316 |   efi_error("iter->offset (%zd) >= iter->len (%zd)",
      |   ^~~~~~~~~
esl-iter.c:338:45: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘long unsigned int’ [-Werror=format=]
  338 |     warnx("correcting ESL size from %d to %zd at %lx",
      |                                           ~~^
      |                                             |
      |                                             int
      |                                           %ld
  339 |           iter->esl->signature_list_size,
  340 |           iter->len - iter->offset, iter->offset);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     long unsigned int
esl-iter.c:363:45: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘long unsigned int’ [-Werror=format=]
  363 |     warnx("correcting ESL size from %d to %zd at 0x%lx",
      |                                           ~~^
      |                                             |
      |                                             int
      |                                           %ld
  364 |           iter->esl->signature_list_size,
  365 |           iter->len - iter->offset, iter->offset);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     long unsigned int
esl-iter.c:414:44: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘long unsigned int’ [-Werror=format=]
  414 |    warnx("correcting ESL size from %d to %zd at 0x%lx",
      |                                          ~~^
      |                                            |
      |                                            int
      |                                          %ld
  415 |          iter->esl->signature_list_size,
  416 |          iter->len - iter->offset, iter->offset);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~
      |                    |
      |                    long unsigned int
gcc -Og  -g3 -Wall -Wextra  -Werror  -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/gcc.specs -fno-merge-constants  -L. -Wl,-rpath=/gnu/store/p33035mlys2dhdq9vgfpsh48c05zxz7b-efivar-38/lib  -Wl,--add-needed -Wl,--build-id -Wl,--no-allow-shlib-undefined -Wl,--no-undefined-version -Wl,-z,now -Wl,-z,muldefs -Wl,-z,relro -Wl,--fatal-warnings     -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/tmp/guix-build-efivar-38.drv-0/efivar-38/src/include/  -shared -Wl,-soname,libefivar.so.1 -Wl,--version-script=libefivar.map  \
	-T guids.lds \
	-o libefivar.so crc32.o dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o efivarfs.o error.o export.o guid.o guid-symbols.o lib.o vars.o time.o -ldl
secdb-dump.c: In function ‘secdb_dump’:
secdb-dump.c:251:14: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘ssize_t’ {aka ‘int’} [-Werror=format=]
  251 |  printf("%08lx\n", offset);
      |          ~~~~^     ~~~~~~
      |              |     |
      |              |     ssize_t {aka int}
      |              long unsigned int
      |          %08x
cc1: all warnings being treated as errors

(See Log file for the complete output.)

Potential patch moved to PR.

Thanks!

@frozencemetery
Copy link
Member

It looks like you're proposing a patch. We appreciate the interest - but please do so as a PR, not a diff in an issue. Thanks!

@itd0
Copy link
Contributor Author

itd0 commented Apr 4, 2022

Makes sense. Thanks for the feedback. (PR: #211)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants