]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
docs: add guidelines for thirdparty includes
authorGovindraj Raja <govindraj.raja@arm.com>
Thu, 2 Mar 2023 13:56:32 +0000 (13:56 +0000)
committerGovindraj Raja <govindraj.raja@arm.com>
Wed, 8 Mar 2023 15:00:23 +0000 (15:00 +0000)
Currently there is no guidelines in docs for including thirdparty
includes, trying to address that with a proposed method to use third
party includes.

Change-Id: Ieec7a5c88a60b66ca72228741ba1894545130a06
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
docs/process/coding-style.rst

index be13b14fafe5c44660c770a054e55deffeea7c5e..483780b3eccc117d6e345b2cff67e6273e5c98a9 100644 (file)
@@ -386,6 +386,27 @@ file names; this type of name reuse should be otherwise avoided.
 
   #include "a_header.h"
 
+The preferred approach for third-party headers is to include them immediately
+following system header files like in the example below, where the
+``version.h`` header from the Mbed TLS library immediately follows the
+``stddef.h`` system header.
+
+.. code:: c
+
+  /* system header files */
+  #include <stddef.h>
+
+  /* Mbed TLS header files */
+  #include <mbedtls/version.h>
+
+  /* project header files */
+  #include <drivers/auth/auth_mod.h>
+  #include <drivers/auth/tbbr_cot_common.h>
+
+  /* platform header files */
+  #include <platform_def.h>
+
+
 Include statement variants
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -463,7 +484,7 @@ Existing typedefs will be retained for compatibility.
 
 --------------
 
-*Copyright (c) 2020, Arm Limited. All rights reserved.*
+*Copyright (c) 2020-2023, Arm Limited. All rights reserved.*
 
 .. _`Linux kernel coding style`: https://www.kernel.org/doc/html/latest/process/coding-style.html
 .. _`MISRA C:2012 Guidelines`: https://www.misra.org.uk/Activities/MISRAC/tabid/160/Default.aspx