From 83fd251ab1bd68281a248132a35203fe0707f29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sat, 17 Jan 2026 15:46:57 +0000 Subject: [PATCH] Prefix possibly unused generated variable with `_` In code generated by `@kernel`, the gensym-ed variable may be unused, causing JETLS to show notes on the function definition. Prefixing the generated name with `_` makes the warning go away, greatly reducing noise in downstream packages when going through JETLS diagnostic messages. --- src/macros.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macros.jl b/src/macros.jl index 696008727..2da784577 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -277,7 +277,7 @@ function emit_cpu(loop) append!(stmts, loop.allocations) # private_allocations turn into lhs = ntuple(i->rhs, length(__workitems_iterspace())) - N = gensym(:N) + N = Symbol("_", gensym(:N)) # Prefix name with `_` because it may be unused, but it's ok push!(stmts, :($N = length($__workitems_iterspace(__ctx__)))) for stmt in loop.private_allocations