The explanation of option "--break-blocks" in astyle is:
Insert empty lines around unrelated blocks, labels, classes, ...
I tried to format the following code with option "--break-blocks":
#include <stdio.h>
int gn = 10;
enum {BEGIN, END};
int test();
int main()
{
return 0;
}
int test()
{
return 0;
}
I got:
#include <stdio.h>
int gn = 10;
enum {BEGIN, END};
int test();
int main()
{
return 0;
}
int test()
{
return 0;
}
An empty line was added between function test and main, but NO empty line added after preprocessors, or between global declarations, or before the first function.
For astyle, a block is always enclosed in parens. So single line statements are not considered. But it should be no problem to add a newline after the preprocessor.