From b6d1f1943771925f2acc96e7c74f8a13b11d85c6 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Sun, 12 Mar 2023 18:29:28 +0300 Subject: [PATCH] usr/fileio/common.c: Fix warning for older versions of GCC Building SCST with an old version of GCC (e.g. 4.8.5 on Centos 7.X) produces a warning about using initializer. This is GCC bug # 53119: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 Hence, use memset() instead of an initializer to avoid this warning. Fixes: e8b300ef2af2 ("usr/fileio/common.c: Fix use of uninitialized struct field") --- usr/fileio/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr/fileio/common.c b/usr/fileio/common.c index c29bdabe0..23a7f2119 100644 --- a/usr/fileio/common.c +++ b/usr/fileio/common.c @@ -792,7 +792,9 @@ void *main_loop(void *arg) struct scst_user_reply_cmd replies[MULTI_CMDS_CNT]; struct scst_user_get_multi multi_cmd; struct scst_user_get_cmd cmds[MULTI_CMDS_CNT]; - } multi = {}; + } multi; + + memset(&multi, 0, sizeof(multi)); TRACE_ENTRY();