21/36] Compiling C object lib/libvfio-user.a.p/libvfio-user.c.o
FAILED: lib/libvfio-user.a.p/libvfio-user.c.o
cc -Ilib/libvfio-user.a.p -Ilib -I../../../libvfio-user/lib -Iinclude -I../../../libvfio-user/include -I/usr/include/json-c -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -O0 -g -gdwarf-4 -fPIC -D_GNU_SOURCE -Werror -DDEBUG -Wno-missing-field-initializers -Wmissing-declarations -Wwrite-strings -MD -MQ lib/libvfio-user.a.p/libvfio-user.c.o -MF lib/libvfio-user.a.p/libvfio-user.c.o.d -o lib/libvfio-user.a.p/libvfio-user.c.o -c ../../../libvfio-user/lib/libvfio-user.c
../../../libvfio-user/lib/libvfio-user.c: In function ‘handle_device_get_region_io_fds’:
../../../libvfio-user/lib/libvfio-user.c:658:38: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
658 | msg->out.fds = calloc(sizeof(int),
| ^~~
../../../libvfio-user/lib/libvfio-user.c:658:38: note: earlier argument should specify number of elements, later size of each element
cc1: all warnings being treated as errors
[28/36] Compiling C object test/unit_tests.p/.._lib_libvfio-user.c.o
FAILED: test/unit_tests.p/.._lib_libvfio-user.c.o
cc -Itest/unit_tests.p -Itest -I../../../libvfio-user/test -Iinclude -I../../../libvfio-user/include -Ilib -I../../../libvfio-user/lib -I/usr/include/json-c -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -O0 -g -gdwarf-4 -DUNIT_TEST -DWITH_TRAN_PIPE -D_GNU_SOURCE -Werror -DDEBUG -Wno-missing-field-initializers -Wmissing-declarations -Wwrite-strings -MD -MQ test/unit_tests.p/.._lib_libvfio-user.c.o -MF test/unit_tests.p/.._lib_libvfio-user.c.o.d -o test/unit_tests.p/.._lib_libvfio-user.c.o -c ../../../libvfio-user/lib/libvfio-user.c
../../../libvfio-user/lib/libvfio-user.c: In function ‘handle_device_get_region_io_fds’:
../../../libvfio-user/lib/libvfio-user.c:658:38: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
658 | msg->out.fds = calloc(sizeof(int),
| ^~~
../../../libvfio-user/lib/libvfio-user.c:658:38: note: earlier argument should specify number of elements, later size of each element
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:21: build] Error 1
make: *** [/root/spdk/mk/spdk.subdirs.mk:16: vfiouserbuild] Error 2
make: *** Waiting for unfinished jobs....
This currently affects SPDK builds under fedora40 (as it uses libvfio-user as a submodule, currently pointing at the aforementioned commit). Something like this seems to help:
Point of failure:
This currently affects SPDK builds under fedora40 (as it uses libvfio-user as a submodule, currently pointing at the aforementioned commit). Something like this seems to help: