From 027fe00d2e32f65815202ed1f2115b32a3a0c0d8 Mon Sep 17 00:00:00 2001 From: Guido Vranken Date: Fri, 21 Aug 2020 10:05:52 +0200 Subject: [PATCH] Prevent triggering Clang 12 -Wstring-concatenation warning Wrap multi-line string literals in parentheses to prevent a Clang 12 -Wstring-concatenation warning (activated by -Wall), which caused the build to fail. Fixes https://github.com/ARMmbed/mbedtls/issues/3586 Signed-off-by: Guido Vranken --- library/md2.c | 4 ++-- library/md4.c | 4 ++-- library/md5.c | 4 ++-- library/ripemd160.c | 4 ++-- library/sha512.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/library/md2.c b/library/md2.c index 5ebf07232a..e6e39c0ac1 100644 --- a/library/md2.c +++ b/library/md2.c @@ -287,8 +287,8 @@ static const unsigned char md2_test_str[7][81] = { "message digest" }, { "abcdefghijklmnopqrstuvwxyz" }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, - { "12345678901234567890123456789012345678901234567890123456789012" - "345678901234567890" } + { ("12345678901234567890123456789012345678901234567890123456789012" + "345678901234567890") } }; static const size_t md2_test_strlen[7] = diff --git a/library/md4.c b/library/md4.c index ac9507454b..7fadfca64e 100644 --- a/library/md4.c +++ b/library/md4.c @@ -408,8 +408,8 @@ static const unsigned char md4_test_str[7][81] = { "message digest" }, { "abcdefghijklmnopqrstuvwxyz" }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, - { "12345678901234567890123456789012345678901234567890123456789012" - "345678901234567890" } + { ("12345678901234567890123456789012345678901234567890123456789012" + "345678901234567890") } }; static const size_t md4_test_strlen[7] = diff --git a/library/md5.c b/library/md5.c index 8cea902aea..147e94b4b8 100644 --- a/library/md5.c +++ b/library/md5.c @@ -422,8 +422,8 @@ static const unsigned char md5_test_buf[7][81] = { "message digest" }, { "abcdefghijklmnopqrstuvwxyz" }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, - { "12345678901234567890123456789012345678901234567890123456789012" - "345678901234567890" } + { ("12345678901234567890123456789012345678901234567890123456789012" + "345678901234567890") } }; static const size_t md5_test_buflen[7] = diff --git a/library/ripemd160.c b/library/ripemd160.c index 830f61b3cd..abb92b7a2f 100644 --- a/library/ripemd160.c +++ b/library/ripemd160.c @@ -478,8 +478,8 @@ static const unsigned char ripemd160_test_str[TESTS][81] = { "abcdefghijklmnopqrstuvwxyz" }, { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, - { "12345678901234567890123456789012345678901234567890123456789012" - "345678901234567890" }, + { ("12345678901234567890123456789012345678901234567890123456789012" + "345678901234567890") }, }; static const size_t ripemd160_test_strlen[TESTS] = diff --git a/library/sha512.c b/library/sha512.c index 80219d4281..a3a28525c3 100644 --- a/library/sha512.c +++ b/library/sha512.c @@ -516,8 +516,8 @@ void mbedtls_sha512( const unsigned char *input, static const unsigned char sha512_test_buf[3][113] = { { "abc" }, - { "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" - "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" }, + { ("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" + "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu") }, { "" } };