Consider following piece of code:
int main () {
int i = 0;
int a, b;
for (i = 0; i < 5; i++)
a = i;
for (i = 0; i < 5; i++)
if (a == i)
b = i;
}
I ran astye as follows:
% astyle --version
Artistic Style Version 3.1
% astyle --style=allman --break-blocks --pad-oper --pad-paren-out --pad-header --unpad-paren --align-pointer=middle --add-brackets --convert-tabs --break-return-type --options=none test.c
int main ()
{
int i = 0;
int a, b;
for (i = 0; i < 5; i++)
{
a = i;
}
for (i = 0; i < 5; i++)
if (a == i)
{
b = i;
}
}
The braces are added to first for loop but not to the second one.
Please fix it.
Regards,
Sulabh
Please try
--add-braces=nestedin the new release 3.4.11.