[cfe-dev] BreakBeforeBraces for GNU coding style

Martin Liška mliska at suse.cz
Tue Aug 5 06:12:57 PDT 2014


Hello,
    I would like to ask you for explanation of BreakBeforeBraces for GNU value:**
*
*BS_GNU (in configuration: GNU) Always break before braces and add an extra level of indentation to braces of control statements, not to those of class, function or other definitions.

Is I understand correctly, there should not be placed breaks for braces for a 'class, function or other definition' ? GNU coding style does not define class, but breaks are always put before braces for a function:

void
foo (int a)
{
return a + 4;
}

Can you please somehow improve documentation?
Another question is closely related: for GNU BreakBeforeBraces, namespace breaks are handled as follows:

namespace aaa {
...
}

Such behavior is not specified in GNU coding conventions, but I would say that:
namespace aaa
{
...
}

fulfills the idea much better? If you like this behavior, I can create a patch?

Thanks,
Martin
**



More information about the cfe-dev mailing list