LeoVen / C-Macro-Collections

Easy to use, modular, header only, macro based, generic and type-safe Data Structures in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling without CMC_CALLBACKS support generates warning

duarm opened this issue · comments

Bug Report template

Describe the bug

Compiling without CMC_CALLBACKS support, generates the following warning with -pedantic:

In file included from /cmc/list.h:84:
/cmc/list/struct.h:43:20: warning: extra ';' inside a struct [-Wextra-semi]
        CMC_CALLBACKS_DECL;

Without CMC_CALLBACKS, CMC_CALLBACKS_DECL is expanded to nothing, so CMC_CALLBACKS_DECL; indeed produces a stray semicolon,

Expected behavior

Perhaps suppress the warning somehow with #pragmas, or something like this

struct {
...
#ifdef CMC_CALLBACKS
     cmc_callback callbacks:
#endif
}