[PATCH] samples/seccomp: Avoid alias warning

From: Kees Cook
Date: Fri Sep 10 2021 - 18:34:18 EST


Under GCC 4.9, fix the warning due to missing -fno-strict-aliasing:

samples/seccomp/user-trap.c:50:2: warning: dereferencing type-punned pointer will break strict-alias
ing rules [-Wstrict-aliasing]
samples/seccomp/user-trap.c:83:2: warning: dereferencing type-punned pointer will break strict-alias
ing rules [-Wstrict-aliasing]

Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
---
samples/seccomp/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index c85ae0ed8342..a3a3ef20a8fc 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -3,4 +3,4 @@ userprogs-always-y += bpf-fancy dropper bpf-direct user-trap

bpf-fancy-objs := bpf-fancy.o bpf-helper.o

-userccflags += -I usr/include
+userccflags += -I usr/include -fno-strict-aliasing
--
2.30.2