Re: [PATCH v2 1/4] util: Remove confusing static keyword use

Denis Kenzior <[email protected]> Tue, 16 Apr 2024 14:07:22 -0500
Newsgroups dev.linux.lists.ell
Message-ID <[email protected]>
On 4/16/24 09:24, Denis Kenzior wrote:
> '__n' is declared as static const which is confusing since it
> would imply that __n is only initialized once.  This works out in the
> end since the macro used in a separate anonymous block, but some compilers
> (i.e. clang) will generate a symbol table entry for '__n'.  This is not
> needed since the expression is always constant.
> 
> Declare '__n' as a const size_t instead since that is the type produced
> by the sizeof() operation used by L_ARRAY_SIZE.
> 
> While here, also declare '__i' as size_t to match '__n'.
> 
> Fixes: 4a9f6388dd7f ("util: Add L_IN_SET macros")
> ---
>   ell/util.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

Applied.