[glib: 1/4] tests: Ignore warning about use of volatile from a test for exactly that




commit 91759dbd638ddca9317950ba5b0a9fd6451cc28b
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Jun 3 13:44:15 2021 +0100

    tests: Ignore warning about use of volatile from a test for exactly that
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #2418

 glib/tests/atomic.c | 3 +++
 1 file changed, 3 insertions(+)
---
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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]