diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html index 977af36225b..8689ef80587 100644 --- a/Documentation/NuttXCCodingStandard.html +++ b/Documentation/NuttXCCodingStandard.html @@ -12,7 +12,7 @@

NuttX C Coding Standard

-

Last Updated: February 9, 2017

+

Last Updated: April 18, 2017

@@ -1291,14 +1291,28 @@ typedef int myinteger_t;
  • No un-named structures. All structures must be named, even if they are part of a type definition. - The exception to this rule is for structures that are defined within another union or structure. In those cases, the structure name should always be omitted. + That is, a structure name must follow the reserved word struct in all structure definitions. + The exception to this rule is for structures that are defined within another union or structure (discouraged). In those cases, the structure name should always be omitted.
  • +
  • + Structured defined with structures discouraged. + Fields within a structure may be another structure that is defined only with the scope of the containing structure. + This practice is acceptable, but discouraged. +
  • +
  • + No un-named structure fields. + Structure may contain other structures as fields. + This this case, the structure field must be named. + C11 permits such un-named structure fields within a structure. + NuttX generally follows C89 and all code outside of architecture specific directories must be compatible with C89.
  • No structure definitions within Type Definition. The practice of defining a structure within a type definition is discouraged. It is preferred that the structure definition and the type definition be separate definitions. In general, the NuttX coding style discourages any typdef-ing of structures; normally the full structure name is used as types throughout the code. + The reason for this is that is structure pointers may be forward referenced in header files without having to include the file the provides the type definition. + This greatly reduces header file coupling.
  • Short structure names. @@ -1373,7 +1387,7 @@ typedef int myinteger_t;

    Incorrect

    -

    Correct

    -