Warning: "extra ; ignored" by using C macros with ARMCC -
my compiler raises warning #381-d: ";" ignored
in such situation:
i have struct defined, following
struct example_s { u8_t foo; some_macro(bar); };
the macro some_macro(x)
following:
#if defined(system_a) #define some_macro(x) u16_t x##something #else #define some_macro(x) /* nothing */ #endif
of course, warning correct, when system_a
not defined. because have ;
within struct. know way avoid correctly? don't want break typical c-style moving ;
macro.
you can add unnamed 0-width bitfield instead:
#if defined(system_a) #define some_macro(x) u16_t x##something #else #define some_macro(x) unsigned :0 #endif
Comments
Post a Comment