Skip to content

Commit

Permalink
kpatch-build: set C language standard to gnu11
Browse files Browse the repository at this point in the history
Add -std=gnu11 to CFLAGS for kpatch-build tooling.  This aligns with the
kernel build and avoids confusion when older tooling may default to
earlier versions.

Closes: dynup#1416 ("C99 code vs. gcc defaults?")
Signed-off-by: Joe Lawrence <[email protected]>
  • Loading branch information
joe-lawrence authored and zhjwong committed Nov 5, 2024
1 parent 0c176e9 commit 5264e5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kpatch-build/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../Makefile.inc

CFLAGS += -MMD -MP -I../kmod/patch -Iinsn -Wall -Wsign-compare \
CFLAGS += -std=gnu11 -MMD -MP -I../kmod/patch -Iinsn -Wall -Wsign-compare \
-Wconversion -Wno-sign-conversion -g -Werror
LDLIBS = -lelf

Expand All @@ -18,7 +18,7 @@ SOURCES += gcc-plugins/ppc64le-plugin.c
PLUGIN = gcc-plugins/ppc64le-plugin.so
TARGETS += $(PLUGIN)
GCC_PLUGINS_DIR := $(shell $(CROSS_COMPILE)gcc -print-file-name=plugin)
PLUGIN_CFLAGS := $(filter-out -Wconversion, $(CFLAGS))
PLUGIN_CFLAGS := $(filter-out -std=gnu11 -Wconversion, $(CFLAGS))
PLUGIN_CFLAGS += -shared -I$(GCC_PLUGINS_DIR)/include \
-Igcc-plugins -fPIC -fno-rtti -O2 -Wall
endif
Expand Down

0 comments on commit 5264e5b

Please sign in to comment.