From: Philippe Benard Date: Thu, 9 Jan 2025 13:59:00 +0000 (+0100) Subject: libcpu: Remove false positive null ptr deref warning for GCC -O3 X-Git-Tag: elfutils-0.193~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=977c4dba220db572fe5ff43b6eb8b81673be0ef7;p=thirdparty%2Felfutils.git libcpu: Remove false positive null ptr deref warning for GCC -O3 i386_lex_CFLAGS is a make variable to tweak the i386_lex.c.o specific compile flags. The are already some -W defined there, I'd like to add one to avoid seeing false warning during build with -O3 compile flag. GCC 14.2 (as well as 13.x) produce a false positive warning for the i386 lexer, a bug is filled already against GCC for that, CLANG is immune. * libcpu/Makefile.am i386_lex_CFLAGS += $(subst -O3,-Wno-null-dereference,$(findstring -O3,$(CFLAGS))) https://sourceware.org/bugzilla/show_bug.cgi?id=32527 Signed-off-by: Philippe Benard --- diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am index 32835237..2e87021b 100644 --- a/libcpu/Makefile.am +++ b/libcpu/Makefile.am @@ -91,6 +91,8 @@ libeu = ../lib/libeu.a i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare \ -Wno-implicit-fallthrough +i386_lex_CFLAGS += $(subst -O3,-Wno-null-dereference,$(findstring -O3,$(CFLAGS))) + i386_parse.o: i386_parse.c i386.mnemonics i386_lex.o: i386_parse.h i386_gendis_LDADD = $(libeu) -lm $(obstack_LIBS)