From a95939c08931c666a076d9c5ea6638f3084d284c Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 11 Oct 2016 18:46:45 -0700 Subject: [PATCH] zombie00 test: fix for clang CLang doesn't like explicit NULL pointer dereference: > zombie00.c:52:5: error: indirection of non-volatile null pointer will be > deleted, not trap [-Werror,-Wnull-dereference] > *(int *)NULL = 0; > ^~~~~~~~~~~~ > zombie00.c:52:5: note: consider using __builtin_trap() or qualifying > pointer with 'volatile' > 1 error generated. Apparently, we need to add volatile to make it happy. Signed-off-by: Kir Kolyshkin Signed-off-by: Pavel Emelyanov --- test/zdtm/static/zombie00.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/zdtm/static/zombie00.c b/test/zdtm/static/zombie00.c index 8ee9c0765..df12a7046 100644 --- a/test/zdtm/static/zombie00.c +++ b/test/zdtm/static/zombie00.c @@ -49,7 +49,7 @@ int main(int argc, char ** argv) if (zombie[i].exited) _exit(zombie[i].exitcode); else if (zombie[i].exitcode == SIGSEGV) - *(int *)NULL = 0; + *(volatile int *)NULL = 0; else kill(getpid(), zombie[i].exitcode);