We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hwinfo/src/hd/hd.c
Line 1824 in c87f449
sizeof returns size_t, so %zu should be used instead of %lu.
sizeof
size_t
%zu
%lu
This may sound insignificant, but on some platforms size_t is unsigned int, and this is different from unsigned long.
unsigned int
unsigned long
make[4]: Entering directory '/home/user/git/openwrt/build_dir/target-mipsel_24kc_musl/hwinfo-21.71' make[5]: Entering directory '/home/user/git/openwrt/build_dir/target-mipsel_24kc_musl/hwinfo-21.71/src' make[6]: Entering directory '/home/user/git/openwrt/build_dir/target-mipsel_24kc_musl/hwinfo-21.71/src/hd' mipsel-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/home/user/git/openwrt/build_dir/target-mipsel_24kc_musl/hwinfo-21.71=hwinfo-21.71 -mips16 -minterlink-mips16 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/user/git/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/include -I/home/user/git/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include/fortify -I/home/user/git/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include -Wall -Wno-pointer-sign -I/home/user/git/openwrt/build_dir/target-mipsel_24kc_musl/hwinfo-21.71/src/hd -Wall -Wno-pointer-sign -fPIC -I../src/hd -Wall -Wno-pointer-sign -fPIC -I../../src/hd -L/home/user/git/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/lib -L/home/user/git/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/lib -fuse-ld=bfd -znow -zrelro -Lsrc -Lsrc -Lsrc hd.c In file included from hd.c:61: hd.c: In function 'hd_scan': hd.c:1823:15: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'unsigned int' [-Wformat=] 1823 | ADD2LOG("libhd version %s%s (%s) [%ld]\n", HD_VERSION_STRING, getuid() ? "u" : "", HD_ARCH, sizeof (hd_data_t)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ | | | unsigned int hd_int.h:66:46: note: in definition of macro 'ADD2LOG' 66 | #define ADD2LOG(a...) hd_log_printf(hd_data, a) | ^ hd.c:1823:43: note: format string is defined here 1823 | ADD2LOG("libhd version %s%s (%s) [%ld]\n", HD_VERSION_STRING, getuid() ? "u" : "", HD_ARCH, sizeof (hd_data_t)); | ~~^ | | | long int | %d mipsel-openwrt-linux-musl-gcc-ar r ../../src/libhd.a hd.o make[6]: Leaving directory '/home/user/git/openwrt/build_dir/target-mipsel_24kc_musl/hwinfo-21.71/src/hd'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
hwinfo/src/hd/hd.c
Line 1824 in c87f449
sizeof
returnssize_t
, so%zu
should be used instead of%lu
.This may sound insignificant, but on some platforms
size_t
isunsigned int
, and this is different fromunsigned long
.The text was updated successfully, but these errors were encountered: