diff --git a/cpukit/include/rtems/score/isrlock.h b/cpukit/include/rtems/score/isrlock.h index a965a9c070..d411e30c6d 100644 --- a/cpukit/include/rtems/score/isrlock.h +++ b/cpukit/include/rtems/score/isrlock.h @@ -200,7 +200,8 @@ static inline void _ISR_lock_Context_set_level( #define _ISR_lock_Initialize( _lock, _name ) \ _SMP_lock_Initialize( &( _lock )->Lock, _name ) #else - #define _ISR_lock_Initialize( _lock, _name ) (void) _name; + #define _ISR_lock_Initialize( _lock, _name ) \ + do { (void) _name; } while (0) #endif /** diff --git a/testsuites/validation/tc-intr-non-smp.c b/testsuites/validation/tc-intr-non-smp.c index 4476d98562..909301bc62 100644 --- a/testsuites/validation/tc-intr-non-smp.c +++ b/testsuites/validation/tc-intr-non-smp.c @@ -82,8 +82,8 @@ * - Check that RTEMS_INTERRUPT_LOCK_INITIALIZER() expands to an empty * structure initializer. * - * - Check that rtems_interrupt_lock_initialize() expands to white space - * only. + * - Check that rtems_interrupt_lock_initialize() expands to a code block + * which marks the second parameter as used. * * - Check that rtems_interrupt_lock_acquire_isr() expands to a code block * which marks the second parameter as used. @@ -139,10 +139,11 @@ static void RtemsIntrValIntrNonSmp_Action_0( void ) T_true( IsEqualIgnoreWhiteSpace( s, "{}" ) ); /* - * Check that rtems_interrupt_lock_initialize() expands to white space only. + * Check that rtems_interrupt_lock_initialize() expands to a code block which + * marks the second parameter as used. */ s = RTEMS_XSTRING( rtems_interrupt_lock_initialize( x, y ) ); - T_true( IsEqualIgnoreWhiteSpace( s, "(void)y;" ) ); + T_true( IsEqualIgnoreWhiteSpace( s, "do{(void)y;}while(0)" ) ); /* * Check that rtems_interrupt_lock_acquire_isr() expands to a code block