summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2021-06-03 13:44:15 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2021-06-03 13:44:15 +0100
commit91759dbd638ddca9317950ba5b0a9fd6451cc28b (patch)
tree303877ce234d2fd76617eadf5e53b54503ac3680
parent04739eb4fdccc17bca88850fd1c55c12fc1a3d64 (diff)
downloadglib-91759dbd638ddca9317950ba5b0a9fd6451cc28b.tar.gz
tests: Ignore warning about use of volatile from a test for exactly that
Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2418
-rw-r--r--glib/tests/atomic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/glib/tests/atomic.c b/glib/tests/atomic.c
index fb8cdcd46..8bc100f4e 100644
--- a/glib/tests/atomic.c
+++ b/glib/tests/atomic.c
@@ -97,9 +97,12 @@ test_types (void)
/* Note that atomic variables should almost certainly not be marked as
* `volatile` — see http://isvolatileusefulwiththreads.in/c/. This test exists
* to make sure that we don’t warn when built against older third party code. */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
g_atomic_pointer_set (&vp_str_vol, NULL);
res = g_atomic_pointer_compare_and_exchange (&vp_str_vol, NULL, str);
g_assert_true (res);
+#pragma GCC diagnostic pop
g_atomic_pointer_set (&ip, 0);
ip2 = g_atomic_pointer_get (&ip);