From 1ae6105ffd184bf0d5aec5db72ea547b380b1aca Mon Sep 17 00:00:00 2001 From: Peter Barada Date: Sat, 28 Feb 2026 14:29:59 -0500 Subject: [PATCH] arm: Rework gcc UNUSED() to cast arg to void Rather than referencing address of arg in short circuited boolean expression (which can cause "always evaluates to true" at higher optimization levels), cast its arg to void. Signed-off-by: Peter Barada --- include/nuttx/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 65cbce4e8d0aa..a604db69b5898 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -625,7 +625,7 @@ /* Indicate that a local variable is not used */ # ifndef UNUSED -# define UNUSED(a) ((void)(1 || &(a))) +# define UNUSED(a) (void)(a) # endif # if defined(__clang__)