RE: [PATCH] doc: drop recommendation against bool in structures

Marat Khalili <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
> -----Original Message-----
> From: Maxime Leroy <[email protected]> On Behalf Of Maxime Leroy
> Sent: Monday 20 July 2026 12:46
> To: [email protected]
> Cc: Stephen Hemminger <[email protected]>; Thomas Monjalon <[email protected]>; David
> Marchand <[email protected]>; Maxime Leroy <[email protected]>
> Subject: [PATCH] doc: drop recommendation against bool in structures
> 
> The coding style advised against bool in structures, citing space and
> type-size concerns inherited from the Linux kernel. That does not match
> DPDK practice: bool is already used in over 1400 structure fields across
> the tree, including core APIs such as rte_flow. Drop the note so the
> style guide reflects actual usage.
> 
> Signed-off-by: Maxime Leroy <[email protected]>
> ---
>  doc/guides/contributing/coding_style.rst | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
> index 976a1e1de3..11de3bb39a 100644
> --- a/doc/guides/contributing/coding_style.rst
> +++ b/doc/guides/contributing/coding_style.rst
> @@ -313,15 +313,6 @@ Structure Declarations
>  * Use of the structures should be by separate variable declarations and those declarations must be
> extern if they are declared in a header file.
>  * Externally visible structure definitions should have the structure name prefixed by ``rte_`` to
> avoid namespace collisions.
> 
> -.. note::
> -
> -    Avoid using ``bool`` in structures because it wastes space and
> -    the type size is unclear. A preferred use of
> -    ``bool`` is mainly as a return type from functions that return true/false,
> -    and maybe local variable functions.
> -
> -    Ref: `LKML <https://lkml.org/lkml/2017/11/21/384>`_
> -

Acked-by: Marat Khalili <[email protected]>

>  Queues
>  ~~~~~~
> 
> --
> 2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.