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

cli_classic.c:718:13: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} #248

Open
kevin-olbrich opened this issue Mar 9, 2022 · 2 comments

Comments

@kevin-olbrich
Copy link

Compiling on Raspberry Pi using Debian Bullseye fails with this error:

root@raspberrypi:~/flashrom# make
Replacing all version templates with v1.2-642-g4bee256.
C compiler found: cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110
Target arch: arm
Target OS: Linux
Target endian: little
Dependency libpci found: yes
  Checking for old "pci_get_dev()": no
  CFLAGS: -I/usr/include/arm-linux-gnueabihf
  LDFLAGS: -lpci -lz -lresolv -ludev
Dependency libusb1 found: no
Dependency libjaylink found: no
Dependency NI-845x found: no
Dependency libftdi1 found: no
Checking for header "mtd/mtd-user.h": yes
Checking for header "linux/spi/spidev.h": yes
Checking for header "linux/i2c-dev.h": yes
Checking for header "linux/i2c.h": yes
Checking for header "sys/utsname.h": yes
Checking for function "clock_gettime": yes
Checking for external "librt": yes
cc -MMD -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings -Werror -I/usr/include/arm-linux-gnueabihf   -D'IS_WINDOWS=0' -D'__FLASHROM_LITTLE_ENDIAN__=1' -D'USE_IOPL=1' -D'USE_DEV_IO=0' -D'USE_IOPERM=0' -D'CONFIG_DEFAULT_PROGRAMMER_NAME=NULL' -D'CONFIG_DEFAULT_PROGRAMMER_ARGS=""' -D'CONFIG_INTERNAL=1' -D'CONFIG_INTERNAL_DMI=1' -D'CONFIG_SERPROG=1' -D'CONFIG_PONY_SPI=1' -D'CONFIG_BITBANG_SPI=1' -D'CONFIG_GFXNVIDIA=1' -D'CONFIG_SATASII=1' -D'CONFIG_ATAVIA=1' -D'CONFIG_IT8212=1' -D'CONFIG_DUMMY=1' -D'CONFIG_DRKAISER=1' -D'CONFIG_NICINTEL=1' -D'CONFIG_NICINTEL_SPI=1' -D'CONFIG_NICINTEL_EEPROM=1' -D'CONFIG_OGP_SPI=1' -D'CONFIG_BUSPIRATE_SPI=1' -D'CONFIG_LINUX_MTD=1' -D'CONFIG_LINUX_SPI=1' -D'NEED_PCI=1' -D'HAVE_UTSNAME=1' -D'HAVE_CLOCK_GETTIME=1' -D'FLASHROM_VERSION="v1.2-642-g4bee256"' -o cli_classic.o -c cli_classic.c
cli_classic.c: In function 'main':
cli_classic.c:718:13: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
  718 |   printf("%ld\n", flashrom_flash_getsize(fill_flash));
      |           ~~^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             |     |
      |             |     size_t {aka unsigned int}
      |             long int
      |           %d
cc1: all warnings being treated as errors
make: *** [Makefile:968: cli_classic.o] Fehler 1
@Th3Fanbus
Copy link
Member

Hi, https://review.coreboot.org/62707 should fix this problem.

@kevin-olbrich
Copy link
Author

kevin-olbrich commented Mar 10, 2022

I can confirm this is fixing the problem. Thank you very much!

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