rhboot / shim

UEFI shim loader
Other
865 stars 293 forks source link

post-process-pe: Fix format string warnings on 32-bit platforms #464

Closed steve-mcintyre closed 2 years ago

steve-mcintyre commented 2 years ago

With -Werror these were causing build failures with stricter gcc:

.../post-process-pe.c: In function 'load_pe': .../post-process-pe.c:177:55: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] .../post-process-pe.c:192:56: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'UINT64' {aka 'long long unsigned int'} [-Werror=format=] .../post-process-pe.c:236:31: error: format '%zu' expects argument of type 'size_t', but argument 2 has type 'UINT64' {aka 'long long unsigned int'} [-Werror=format=] .../post-process-pe.c:39:32: note: in definition of macro 'debug' .../post-process-pe.c:236:60: note: format string is defined here .../post-process-pe.c:240:31: error: format '%zu' expects argument of type 'size_t', but argument 2 has type 'UINT64' {aka 'long long unsigned int'} [-Werror=format=] .../post-process-pe.c:39:32: note: in definition of macro 'debug' .../post-process-pe.c:240:60: note: format string is defined here .../post-process-pe.c:274:30: error: format '%zu' expects argument of type 'size_t', but argument 2 has type 'UINTN' {aka 'long unsigned int'} [-Werror=format=] .../post-process-pe.c:39:32: note: in definition of macro 'debug' .../post-process-pe.c:274:34: note: format string is defined here