Changes between Version 26 and Version 27 of CodeStyle


Ignore:
Timestamp:
11/29/20 18:16:03 (3 years ago)
Author:
Gert Döring
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodeStyle

    v26 v27  
    2020 * Indentation is 4 spaces, no tabs ever.
    2121 * Opening and closing brackets get their own line, and must match indentation.
    22  * Line length is 80 characters.
     22 * Line length is 80 characters (soft limit) but may be extended up to 120 if wrapping makes the result less readable / more ugly
    2323 * C99 is allowed.  E.g. `for (int i = 0; i < max; i++)`.
    2424 * Only use `/* */`-style comments
     
    4141If you find yourself continuously exceeding the line limit, you might want to consider breaking up your function into smaller functions to reduce nesting.
    4242
     43Single lines may use up to 120 characters if the resulting code is more readable than if wrapped.  But this should be an exception, no whole code blocks should be written with "more than 80 as a general norm".
     44
    4345= Some additional secure coding style rules =
    4446
    4547This are **style rules**, ''not'' general secure coding guide lines.  See e.g. https://www.securecoding.cert.org/confluence/display/c/SEI+CERT+C+Coding+Standard for useful guidelines on writing secure C.
    4648
    47 == All branches should use braces ==
     49== All branches must use braces ==
    4850
    4951For example:
     
    9698
    9799
    98 = Crustify rules =
     100= Uncrustify rules =
    99101The most fit tool for our purpose (because it can be told to just leave certain constructs alone, while changing others) seems to be
    100102