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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -