Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftest: af_unix: Support compilers without flex-array-member-not-at-end support

Fix:

gcc: error: unrecognized command-line option ‘-Wflex-array-member-not-at-end’

by making the compiler option dependent on its support.

Fixes: 1838731f1072c ("selftest: af_unix: Add -Wall and -Wflex-array-member-not-at-end to CFLAGS.")
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/20251205171010.515236-7-linux@roeck-us.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Guenter Roeck and committed by
Jakub Kicinski
06f7cae9 9580f6d4

+6 -1
+6 -1
tools/testing/selftests/net/af_unix/Makefile
··· 1 - CFLAGS += $(KHDR_INCLUDES) -Wall -Wflex-array-member-not-at-end 1 + top_srcdir := ../../../../.. 2 + include $(top_srcdir)/scripts/Makefile.compiler 3 + 4 + cc-option = $(call __cc-option, $(CC),,$(1),$(2)) 5 + 6 + CFLAGS += $(KHDR_INCLUDES) -Wall $(call cc-option,-Wflex-array-member-not-at-end) 2 7 3 8 TEST_GEN_PROGS := \ 4 9 diag_uid \