c - Astyle with --remove-brackets and a macro -



c - Astyle with --remove-brackets and a macro -

with code:

#define macro(a,b) foo(a); bar(b) if(true) { macro(a,b); }

astyle remove brackets around macro call

if(true) macro(a,b);

fortunately found solution. if place ; within macro, astyle understand it.

#define macro(a,b) foo(a); bar(b); if(true) { macro(a,b) }

is solution, bug astyle or misunderstanding?

it's bad style.

if absolutely must have multiple statements in macro, wrap them in do while loop (note lack of semicolon @ end):

#define macro(a,b) { foo(a); bar(b); } while(0)

c astyle

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -