[glib/wip/pwithnall/restore-macos-ci: 98/98] 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: 98/98] tests: Silence set-but-not-used warnings for variables in autoptr test
- Date: Tue, 7 Jun 2022 17:27:26 +0000 (UTC)
commit 98df887b7fe70f1ff0b77e8bf68c6547db2cd321
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]