From 76d37a714ef20c5b260baa7d1d2c4ae101ddee55 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 11 Sep 2025 18:25:58 -0500 Subject: [PATCH] libdebugger/rtems-debugger-arm.c: Fix using defined() in expansion The definition of NEEDS_THUMB_SWITCH was not portable and flagged by the GCC -Wexpansion-to-defined. It is not portable to expand a macro which uses futher cpp directives. Closes #5328. --- cpukit/libdebugger/rtems-debugger-arm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpukit/libdebugger/rtems-debugger-arm.c b/cpukit/libdebugger/rtems-debugger-arm.c index cdc615ce64..6ec9dba029 100644 --- a/cpukit/libdebugger/rtems-debugger-arm.c +++ b/cpukit/libdebugger/rtems-debugger-arm.c @@ -80,9 +80,7 @@ * * If the variant only supports thumb insturctions disable the support. */ -#define NEEDS_THUMB_SWITCH !ARM_THUMB_ONLY && defined(__thumb__) - -#if NEEDS_THUMB_SWITCH +#if !ARM_THUMB_ONLY && defined(__thumb__) #define ARM_SWITCH_REG uint32_t arm_switch_reg #define ARM_SWITCH_REG_ASM [arm_switch_reg] "=&r" (arm_switch_reg) #define ARM_SWITCH_REG_ASM_L ARM_SWITCH_REG_ASM,