[PATCH 19.11] net/ice: build failure with make and GCC > 11

Steve Yang stevex.yang at intel.com
Wed Jan 12 07:45:05 CET 2022


Since GCC version is greater than 11.1.1, the '-finline-functions'
option perhaps causes '-Werror=maybe-uninitialized' issue.

Check the gcc version, and enable '-Wno-maybe-uninitialized',
otherwise it will have "error: ‘r_bitmap’ may be used uninitialized".

Bugzilla ID: 744

Signed-off-by: Steve Yang <stevex.yang at intel.com>
---
 drivers/net/ice/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile
index 6c4d155268..07044d6ed7 100644
--- a/drivers/net/ice/Makefile
+++ b/drivers/net/ice/Makefile
@@ -34,6 +34,10 @@ ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
 CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
 endif
 
+ifeq ($(shell test $(GCC_VERSION) -ge 110 && echo 1), 1)
+CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized
+endif
+
 endif
 OBJS_BASE_DRIVER=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))
 $(foreach obj, $(OBJS_BASE_DRIVER), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER)))
-- 
2.27.0



More information about the stable mailing list