Re: [PATCH 5/5] clang-format: Squash empty loops into a single line

Jan Kiszka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
On 13.05.26 14:50, Florian Bezdeka wrote:
>         while (cond) {    vs   while (cond) {}
>         }
> 
> The alternative
> 
>         while (cond)
>                 continue;
> 
> triggered a warning inside the analyzer:
> Redundant control flow jump statement.
> 

This should be obsolete when patch 3 and 4 are reworked, no?

Jan

> Signed-off-by: Florian Bezdeka <[email protected]>
> ---
>  .clang-format | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.clang-format b/.clang-format
> index 2ffd69afc1a8280654a8763e044e27e08be7a69f..2792bc6a0b6f8d6eba81e2dbf7d0c6ba745707ca 100755
> --- a/.clang-format
> +++ b/.clang-format
> @@ -17,7 +17,7 @@ AlignConsecutiveDeclarations: false
>  AlignOperands: true
>  AlignTrailingComments: false
>  AllowAllParametersOfDeclarationOnNextLine: false
> -AllowShortBlocksOnASingleLine: false
> +AllowShortBlocksOnASingleLine: Empty
>  AllowShortCaseLabelsOnASingleLine: false
>  AllowShortFunctionsOnASingleLine: None
>  AllowShortIfStatementsOnASingleLine: false
> 

-- 
Siemens AG, Foundational Technologies
Linux Expert Center
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.