why using do{}while(0)
in macro expansion
#define FN(x) do{ f1(x); f2(x);} while(0)
Below code will do the same right?
#define FN(x) { f1(x); f2(x); }
if(condition)
FN(val) // **without a semicolon**
else
f3();
which simply expands like below.
if(condition)
{ f1(val); f2(val); }
else
f3();
There is no issue seems in macro use FN(val) without a semicolon in GCC.