Skip to contentSkip to conversation

erofs-utils: tests: fix build warning in test_LZ4_compress_HC_destSize

PATCH In review Yue Hu 2 participants 2 messages Nov 24, 2023

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

PATCH v2 2/2 erofs-utils: tests: fix build warning in test_LZ4_compress_HC_destSize

From: Yue Hu <[email protected]>

badlz4.c:72:58: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
printf("test LZ4_compress_HC_destSize(%d) error (%d < %d)\n",

                                                         ~^
                                                         %ld
---
 tests/src/badlz4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/src/badlz4.c +1 -1
index f2f1f05..221b714 100644
@@ -70,7 +70,7 @@ int test_LZ4_compress_HC_destSize(int inlen)
 	LZ4_freeStreamHC(ctx);
 	if (SrcSize <= sizeof(dst)) {
 		printf("test LZ4_compress_HC_destSize(%d) error (%d < %d)\n",
-		       inlen, SrcSize, sizeof(dst));
+		       inlen, SrcSize, (int)sizeof(dst));
 		return 1;
 	}
 	printf("test LZ4_compress_HC_destSize(%d) OK\n", inlen);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 8 lines · Yue Hu

From: Yue Hu <[email protected]>

badlz4.c:72:58: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]

    printf("test LZ4_compress_HC_destSize(%d) error (%d < %d)\n",
                                                          ~^
                                                          %ld

Thanks, folded this with your SoB.

Thanks,
Gao Xiang