>From 929fb2091ffe50a35a1b2dae1f1ce20357bc435b Mon Sep 17 00:00:00 2001 From: shynur <one.last.k...@outlook.com> Date: Thu, 9 Jan 2025 14:11:38 +0800 Subject: [PATCH] Avoid unused-variable-error when configured with 'CFLAGS=-DNDEBUG'
--- libgomp/target.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libgomp/target.c b/libgomp/target.c index 9fc51b160f0..dbc4535b96f 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -2092,8 +2092,9 @@ gomp_unmap_vars_internal (struct target_mem_desc *tgt, bool do_copyfrom, tgt->list[i].length); if (do_remove) { - struct target_mem_desc *k_tgt = k->tgt; - bool is_tgt_unmapped = gomp_remove_var (devicep, k); + struct target_mem_desc *k_tgt __attribute__((unused)) = k->tgt; + bool is_tgt_unmapped __attribute__((unused)) + = gomp_remove_var (devicep, k); /* It would be bad if TGT got unmapped while we're still iterating over its LIST_COUNT, and also expect to use it in the following code. */ -- 2.45.2