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>
This commit is contained in:
Daniel Stone 2018-08-24 16:48:13 +01:00
parent 4939923d3a
commit 9575d1c772

View File

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