[openssl-project] Style guide update -- summary so far

Matt Caswell matt at openssl.org
Mon Feb 5 19:45:12 UTC 2018



On 05/02/18 19:43, Dr. Matthias St. Pierre wrote:
> 
> Wasn't there also the suggestion by someone that if one part of an
> if-else statements needs braces that the other part should get some, too?

That's already in the style guide:


Do not unnecessarily use braces around a single statement:

    if (condition)
        action();

and

    if (condition)
        do_this();
    else
        do_that();

If one of the branches is a compound statement, then use braces on both
parts:

    if (condition) {
        do_this();
        do_that();
    } else {
        otherwise();
    }




Matt



More information about the openssl-project mailing list