[glib/wip/pwithnall/restore-macos-ci] tests: Silence set-but-not-used warnings for variables in autoptr test
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/pwithnall/restore-macos-ci] tests: Silence set-but-not-used warnings for variables in autoptr test
- Date: Fri, 27 May 2022 14:44:08 +0000 (UTC)
commit 8342b7d0df39dd771cf1e103e39de10f4f898d7e
Author: Philip Withnall <pwithnall endlessos org>
Date: Fri May 27 15:39:38 2022 +0100
tests: Silence set-but-not-used warnings for variables in autoptr test
Clang decides that `p` and `p2` are set but not used. Try a bit harder
to trick it.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/tests/autoptr.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/glib/tests/autoptr.c b/glib/tests/autoptr.c
index 59471d02f4..1b2dd7b094 100644
--- a/glib/tests/autoptr.c
+++ b/glib/tests/autoptr.c
@@ -20,6 +20,9 @@ test_autofree (void)
p = g_malloc (10);
p2 = g_malloc (42);
+ p[0] = 1;
+ p2[0] = 1;
+
if (TRUE)
{
g_autofree guint8 *buf = g_malloc (128);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]