From f032e3feb0f638d06e47c08cb9037f298a9db065 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Tue, 3 Jan 2023 11:22:17 +0000 Subject: [PATCH] fix those particular gcc analyzer warning (#582) --- src/snmalloc/ds_core/helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/snmalloc/ds_core/helpers.h b/src/snmalloc/ds_core/helpers.h index 7b2cca2..e1e41d3 100644 --- a/src/snmalloc/ds_core/helpers.h +++ b/src/snmalloc/ds_core/helpers.h @@ -322,7 +322,7 @@ namespace snmalloc append_char('-'); s = 0 - s; } - std::array buf; + std::array buf{{0}}; const char digits[] = "0123456789"; for (long i = long(buf.size() - 1); i >= 0; i--) { @@ -352,7 +352,7 @@ namespace snmalloc { append_char('0'); append_char('x'); - std::array buf; + std::array buf{{0}}; const char hexdigits[] = "0123456789abcdef"; // Length of string including null terminator static_assert(sizeof(hexdigits) == 0x11);