meekrosoft / fff

A testing micro framework for creating function test doubles
Other
768 stars 169 forks source link

warning: extra ‘;’ [-Wpedantic] #90

Open corentinmusard opened 4 years ago

corentinmusard commented 4 years ago

On gcc and clang, there is this warning when you put a ';' at then end of each macro when compiling with -pedantic.

// test.c(pp)
#include "fff.h"
DEFINE_FFF_GLOBALS;
FAKE_VOID_FUNC(DISPLAY_init);
acazzaniga commented 4 years ago

any update on this?

m0rtalis commented 3 years ago

Then don't do it?

nradulovic commented 2 years ago

"Then don't do it" is not a solution. Macros should be implemented in such a way that when they are used in an expression they are always terminated with ";"