From 942a0b8056a2157e921a86a7076a8b9f8c3b77a1 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Thu, 24 Aug 2023 14:19:38 -0700 Subject: [PATCH] Makefile: silence GCC's bogus complaint about possible NULL in printf GCC started complaining that some of libbpf pr_warn() statements might be passing NULL for map name. Map name is never NULL for non-NULL map pointer, so this is a false positive which triggers build failures. Silence format-overflow warning altogether to avoid this in the future as well. Signed-off-by: Andrii Nakryiko --- src/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 349a5dd..35c5724 100644 --- a/src/Makefile +++ b/src/Makefile @@ -35,7 +35,10 @@ ALL_CFLAGS := $(INCLUDES) SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89 -ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS) +ALL_CFLAGS += $(CFLAGS) \ + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ + -Wno-unknown-warning-option -Wno-format-overflow \ + $(EXTRA_CFLAGS) ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS) ifdef NO_PKG_CONFIG