]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Fix printf format for TEST_COMPARE_STRING
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 7 Nov 2018 13:09:02 +0000 (11:09 -0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 30 Nov 2020 22:59:53 +0000 (22:59 +0000)
Fix the following on 32 bits targets:

support_test_compare_string.c: In function 'support_test_compare_string':
support_test_compare_string.c:80:37: error: format '%lu' expects argument of
type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'}
[-Werror=format=]
         printf ("  string length: %lu bytes\n", left_length);
                                   ~~^           ~~~~~~~~~~~
                                   %u
Checked on arm-linux-gnueabihf.

* support/support_test_compare_string.c
(support_test_compare_string): Fix printf format.

(cherry picked from commit 00c86a37d1b63044e3169d1f2ebec23447c73f79)

ChangeLog
support/support_test_compare_string.c

index ba53136bece93da3707c3e869eec09962b3c52aa..190b9ea0d03a472ba1e4532e013f492500bef6a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-07  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * support/support_test_compare_string.c
+       (support_test_compare_string): Fix printf format.
+
 2018-11-07  Florian Weimer  <fweimer@redhat.com>
 
        Implement TEST_COMPARE_STRING.
index 9958aaeec170aee989fb20a3eac8af58c1e54e15..a76ba8eda7782d9d0426f33db85dcae6ed3da62e 100644 (file)
@@ -77,7 +77,7 @@ support_test_compare_string (const char *left, const char *right,
       support_record_failure ();
       printf ("%s:%d: error: blob comparison failed\n", file, line);
       if (left_length == right_length && right != NULL && left != NULL)
-        printf ("  string length: %lu bytes\n", left_length);
+        printf ("  string length: %zu bytes\n", left_length);
       else
         {
           report_length ("left", left, left_length);