File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,11 +130,18 @@ endif
130130GCCVERGE12 = $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 12)
131131ifeq "$(GCCVERGE12 ) " "1"
132132 CFLAGS+ = -Wno-error=array-bounds
133- CFLAGS+ = -Wno-error=cast-qual
134- CFLAGS+ = -Wno-error=format
135- CFLAGS+ = -Wno-error=format-extra-args
136133endif
137134
135+ # FreeBSD's kernel printf uses %D (hex dump format) which is unknown to GCC's
136+ # format checker. Disable -Werror=format and -Werror=format-extra-args on every
137+ # GCC version so the FreeBSD-derived sources still build.
138+ CFLAGS+ = -Wno-error=format
139+ CFLAGS+ = -Wno-error=format-extra-args
140+
141+ # cast-qual is triggered by FreeBSD's atomic_store_ptr macro on every supported
142+ # GCC version (including GCC 8), so disable -Werror=cast-qual unconditionally.
143+ CFLAGS+ = -Wno-error=cast-qual
144+
138145GCCVERGE13 = $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 13)
139146ifeq "$(GCCVERGE13 ) " "1"
140147 CFLAGS+ = -Wno-error=dangling-pointer
Original file line number Diff line number Diff line change @@ -35,7 +35,13 @@ CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
3535endif
3636
3737ifeq (${COMPILER_TYPE},gcc)
38+ # -Wno-address-of-packed-member was added in GCC 9.0, omit it on older GCC
39+ GCCVER_GE9 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 9)
40+ ifeq "$(GCCVER_GE9 ) " "1"
3841CWARNEXTRA? = -Wno-unused-but-set-variable -Wno-address-of-packed-member
42+ else
43+ CWARNEXTRA? = -Wno-unused-but-set-variable
44+ endif
3945endif
4046
4147#
You can’t perform that action at this time.
0 commit comments