Fix the compile error once enabled Werror
authorXiaokang Qian <xiaokang.qian@arm.com>
Wed, 11 Mar 2020 05:37:24 +0000 (05:37 +0000)
committerTomas Mraz <tmraz@fedoraproject.org>
Mon, 16 Mar 2020 09:51:20 +0000 (10:51 +0100)
On 32 bit operating system,size_t is defined as unsigned int,
this is the return type of strlen(), but it isn't aligned with the %ld,
when compiling, warning will be reported.
Change the type to %zu to avoid the warning.

Change-Id: I2943d0dfba88ef42892f14230242008473d6263b

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11325)

test/cmp_ctx_test.c

index 903e204622ac82626376c2a97fb86c9d17e80464..fa4ef911bfb34f9abc6499d3cedd25707d51503b 100644 (file)
@@ -118,7 +118,7 @@ static int msg_total_size_log_cb(const char *func, const char *file, int line,
                                  OSSL_CMP_severity level, const char *msg)
 {
     msg_total_size += strlen(msg);
-    TEST_note("total=%d len=%ld msg='%s'\n", msg_total_size, strlen(msg), msg);
+    TEST_note("total=%d len=%zu msg='%s'\n", msg_total_size, strlen(msg), msg);
     return 1;
 }