diff options
| author | Daniel Stone <daniels@collabora.com> | 2018-08-24 16:48:13 +0100 |
|---|---|---|
| committer | Daniel Stone <daniels@collabora.com> | 2018-08-29 09:59:04 +0100 |
| commit | 9575d1c772378df73cd421997b70d4a880575911 (patch) | |
| tree | 512d0378803bc58533ba9836c79dec274751fb25 /tests | |
| parent | scanner: Reverse expat/libxml include order (diff) | |
| download | wayland-9575d1c772378df73cd421997b70d4a880575911.tar wayland-9575d1c772378df73cd421997b70d4a880575911.tar.gz wayland-9575d1c772378df73cd421997b70d4a880575911.tar.bz2 wayland-9575d1c772378df73cd421997b70d4a880575911.tar.lz wayland-9575d1c772378df73cd421997b70d4a880575911.tar.xz wayland-9575d1c772378df73cd421997b70d4a880575911.tar.zst wayland-9575d1c772378df73cd421997b70d4a880575911.zip | |
tests: Use volatile pointer for NULL dereference
Clang warns that it can silently discard a non-volatile write to a NULL
pointer (perhaps it constitutes undefined behaviour?), and recommends
changing it to volatile.
This patch slavishly complies with the demand of the unfeeling machine.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/sanity-test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/sanity-test.c b/tests/sanity-test.c index 66ca16f..2495a11 100644 --- a/tests/sanity-test.c +++ b/tests/sanity-test.c @@ -70,8 +70,10 @@ FAIL_TEST(fail_kill) FAIL_TEST(fail_segv) { + char * volatile *null = 0; + test_disable_coredumps(); - * (char **) 0 = "Goodbye, world"; + *null = "Goodbye, world"; } FAIL_TEST(sanity_assert) |
