From 1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 19 Oct 2021 17:28:18 +0200 Subject: passt: Address gcc 11 warnings A mix of unchecked return values, a missing permission mask for open(2) with O_CREAT, and some false positives from -Wstringop-overflow and -Wmaybe-uninitialized. Reported-by: Martin Hauke Signed-off-by: Stefano Brivio --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c2077f2..6d11e22 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,20 @@ CFLAGS += -DPAGE_SIZE=$(shell getconf PAGE_SIZE) CFLAGS += -DNETNS_RUN_DIR=\"/run/netns\" CFLAGS += -DPASST_AUDIT_ARCH=AUDIT_ARCH_$(shell uname -m | tr [a-z] [A-Z]) +# On gcc 11.2, with -O2 and -flto, tcp_hash() and siphash_20b(), if inlined, +# seem to be hitting something similar to: +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78993 +# from the pointer arithmetic used from the tcp_tap_handler() path to get the +# remote connection address. +ifeq ($(shell $(CC) -dumpversion),11) +ifneq (,$(filter -flto%,$(CFLAGS))) +ifneq (,$(filter -O2,$(CFLAGS))) + CFLAGS += -DTCP_HASH_NOINLINE + CFLAGS += -DSIPHASH_20B_NOINLINE +endif +endif +endif + prefix ?= /usr/local all: passt pasta passt4netns qrap -- cgit v1.2.3