[PATCH 1/9] tests/basic: silence GCC-8 warning

Jussi Kivilinna jussi.kivilinna at iki.fi
Tue Jun 19 17:44:44 CEST 2018


* tests/basic.c (check_ofb_cipher, check_stream_cipher): Change
tv[].data[].inlen type from signed to unsigned integer.
--

Patch silences new GCC-8 compiler warning:
 '__builtin_memcmp_eq' specified size between 18446744071562067968 and
 18446744073709551615 exceeds maximum object size 9223372036854775807
 [-Wstringop-overflow=]

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 tests/basic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/basic.c b/tests/basic.c
index 42ee819e7..f3d895153 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -1112,7 +1112,7 @@ check_ofb_cipher (void)
     struct data
     {
       unsigned char plaintext[MAX_DATA_LEN];
-      int inlen;
+      unsigned int inlen;
       char out[MAX_DATA_LEN];
     }
     data[MAX_DATA_LEN];
@@ -5660,7 +5660,7 @@ check_stream_cipher (void)
     const char *iv;
     struct data
     {
-      int inlen;
+      unsigned int inlen;
       const char *plaintext;
       const char *out;
     } data[MAX_DATA_LEN];
-- 
2.17.1




More information about the Gcrypt-devel mailing list