From: Bruno Haible Date: Mon, 4 Sep 2023 14:02:36 +0000 (+0200) Subject: string-buffer tests: Fix a gcc -Wformat warning. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=1de9794fe0bece62e9101065a42c689fcdc6aa43;p=gnulib.git string-buffer tests: Fix a gcc -Wformat warning. * tests/test-string-buffer.c: Include . Don't assume that wint_t has the same size as 'int'. --- diff --git a/ChangeLog b/ChangeLog index 04fe6fe674..d64702a63b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2023-09-04 Bruno Haible + string-buffer tests: Fix a gcc -Wformat warning. + * tests/test-string-buffer.c: Include . Don't assume that + wint_t has the same size as 'int'. + crypto/* tests: Fix some gcc -Wdiscarded-qualifiers warnings. * tests/test-gc-hmac-md5.c (main): Change type of variables with a string literal initializer to 'const char *'. diff --git a/tests/test-string-buffer.c b/tests/test-string-buffer.c index 3d26ad25b9..e5c2c5f918 100644 --- a/tests/test-string-buffer.c +++ b/tests/test-string-buffer.c @@ -21,6 +21,7 @@ #include "string-buffer.h" #include +#include #include "macros.h" @@ -101,7 +102,7 @@ main () sb_init (&buffer); sb_append (&buffer, "<"); - sb_appendf (&buffer, "%lc", 0x76543210); + sb_appendf (&buffer, "%lc", (wint_t) 0x76543210); sb_append (&buffer, "|"); sb_appendf (&buffer, invalid_format_string_1, 1); sb_append (&buffer, "|");