From 0f29dcacafa9589629bda1c8149729d1df5c6d69 Mon Sep 17 00:00:00 2001 From: Yossi Itigin Date: Mon, 8 Mar 2021 21:28:12 +0200 Subject: [PATCH] UCS/SOCK: Fix RPM build with gcc11 on fedora34 --- NEWS | 1 + src/ucs/sys/sock.c | 1 + test/gtest/common/gtest-all.cc | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 870145deabd..4ab08c37648 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ ## 1.10.1 (TBD) ### Bugfixes: * Fix Infiniband port speed detection for HDR100 +* Fix build issues in gtest-all.cc and sock.c with GCC11 ## 1.10.0 (March 9, 2021) ### Features: diff --git a/src/ucs/sys/sock.c b/src/ucs/sys/sock.c index adc8e4227d9..b52ddcfb189 100644 --- a/src/ucs/sys/sock.c +++ b/src/ucs/sys/sock.c @@ -374,6 +374,7 @@ ucs_status_t ucs_socket_server_init(const struct sockaddr *saddr, socklen_t sock int ret, fd; /* Create the server socket for accepting incoming connections */ + fd = -1; /* Suppress compiler warning */ status = ucs_socket_create(saddr->sa_family, SOCK_STREAM, &fd); if (status != UCS_OK) { goto err; diff --git a/test/gtest/common/gtest-all.cc b/test/gtest/common/gtest-all.cc index fa67e68e6ab..e6d31bd5b1e 100644 --- a/test/gtest/common/gtest-all.cc +++ b/test/gtest/common/gtest-all.cc @@ -7489,7 +7489,7 @@ void StackLowerThanAddress(const void* ptr, bool* result) { } bool StackGrowsDown() { - int dummy; + int dummy = 0; bool result; StackLowerThanAddress(&dummy, &result); return result;