Skip to content

Commit

Permalink
coding standard: initialize arrays with { }
Browse files Browse the repository at this point in the history
Except for optee_client, arrays should be initialized with { }.

Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
  • Loading branch information
jforissier authored and jbech-linaro committed Aug 27, 2021
1 parent fcc1280 commit 12002db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions general/coding_standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Variables are initialized according to these general guidelines:
the more clumsy ``memset()`` procedure. Types like ``pthread_t``
which can be a scalar or a composite type are initialized with
``memset()`` in order to minimize the amount of future headache.
Arrays are initialized with ``{ }``, too.

Unsigned integer constants are defined using the ``U()``, ``UL()`` or
``ULL()`` macros, depending on the required width. ``U()`` is a good choice
Expand Down

0 comments on commit 12002db

Please sign in to comment.