2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

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 <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Kir Kolyshkin 2016-10-11 18:46:45 -07:00 committed by Pavel Emelyanov
parent 3c75cf5198
commit a95939c089

View File

@ -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);