diff options
author | J.W. Jagersma <jwjagersma@gmail.com> | 2022-10-01 18:41:44 +0200 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2022-11-14 07:47:53 +0000 |
commit | 1555c86e5f7e3c46b4f696ed665c2f988976b81f (patch) | |
tree | f7f131a40e8f3f4ea2e24206ad7762a00fd7f0c0 /test | |
parent | 43086b1bd48958ce95fadba8459ad88675da4fdf (diff) | |
download | openssl-new-1555c86e5f7e3c46b4f696ed665c2f988976b81f.tar.gz |
Cast values to match printf format strings.
For some reason djgpp uses '(unsigned) long int' for (u)int32_t. This
causes errors with -Werror=format, even though these types are in
practice identical.
Obvious solution: cast to the types indicated by the format string.
For asn1_time_test.c I changed the format string to %lli since time_t
may be 'long long' some platforms.
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19322)
Diffstat (limited to 'test')
-rw-r--r-- | test/asn1_time_test.c | 6 | ||||
-rw-r--r-- | test/ssl_cert_table_internal_test.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/test/asn1_time_test.c b/test/asn1_time_test.c index b222b44091..3344b76eae 100644 --- a/test/asn1_time_test.c +++ b/test/asn1_time_test.c @@ -434,8 +434,10 @@ static int convert_asn1_to_time_t(int idx) testdateutc = ossl_asn1_string_to_time_t(asn1_to_utc[idx].input); if (!TEST_time_t_eq(testdateutc, asn1_to_utc[idx].expected)) { - TEST_info("ossl_asn1_string_to_time_t (%s) failed: expected %li, got %li\n", - asn1_to_utc[idx].input, asn1_to_utc[idx].expected, (signed long) testdateutc); + TEST_info("ossl_asn1_string_to_time_t (%s) failed: expected %lli, got %lli\n", + asn1_to_utc[idx].input, + (long long int)asn1_to_utc[idx].expected, + (long long int)testdateutc); return 0; } return 1; diff --git a/test/ssl_cert_table_internal_test.c b/test/ssl_cert_table_internal_test.c index 1dc09c013c..397834a8f1 100644 --- a/test/ssl_cert_table_internal_test.c +++ b/test/ssl_cert_table_internal_test.c @@ -35,7 +35,8 @@ static int do_test_cert_table(int nid, uint32_t amask, size_t idx, TEST_note("Expected %s, got %s\n", OBJ_nid2sn(nid), OBJ_nid2sn(clu->nid)); if (clu->amask != amask) - TEST_note("Expected auth mask 0x%x, got 0x%x\n", amask, clu->amask); + TEST_note("Expected auth mask 0x%x, got 0x%x\n", + (unsigned int)amask, (unsigned int)clu->amask); return 0; } |