public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top, jfiusdq@proton.me,
	Laurent Vivier <lvivier@redhat.com>
Subject: Re: [PATCH 3/3] clang-tidy: Don't insist on #ifdef over #if defined()
Date: Thu, 05 Mar 2026 01:38:39 +0100 (CET)	[thread overview]
Message-ID: <20260305013838.2314da66@elisabeth> (raw)
In-Reply-To: <20260302043135.800803-4-david@gibson.dropbear.id.au>

On Mon,  2 Mar 2026 15:31:35 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> Commit 036fb8770 ("checksum: add VSX fast path for POWER8/POWER9") changed
> an #ifdef to #if defined, in order to match a newly introduced #if which
> needs to check two different symbols.  This causes clang-tidy to complain
> that the directive could be written more concisely.
> 
> In this case consistency with the other #if branch seems more important,
> and in general insisting on #ifdef over #if seems unhelpfully pedantic.
> Suppress that warning globally.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied with:

Fixes: 036fb8770cc2 ("checksum: add VSX fast path for POWER8/POWER9")
Reported-by: Laurent Vivier <lvivier@redhat.com>

> ---
>  .clang-tidy | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/.clang-tidy b/.clang-tidy
> index 9d346ec2..773121f5 100644
> --- a/.clang-tidy
> +++ b/.clang-tidy
> @@ -81,6 +81,11 @@ Checks:
>      #	precedence over addition in modern mathematical notation. Adding
>      #	parentheses to reinforce that certainly won't improve readability.
>      - "-readability-math-missing-parentheses"
> +
> +    # #if defined(FOO) is fine, and can be more consistent with other
> +    # #if directives.  Don't insist on #ifdef instead.
> +    - "-readability-use-concise-preprocessor-directives"
> +
>  WarningsAsErrors: "*"
>  HeaderFileExtensions:
>      - h

-- 
Stefano


      reply	other threads:[~2026-03-05  0:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02  4:31 [PATCH 0/3] Miscellaneous minor fixes David Gibson
2026-03-02  4:31 ` [PATCH 1/3] tcp: Use flow_foreach_of_type() in tcp_{keepalive,inactivity} David Gibson
2026-03-05  0:38   ` Stefano Brivio
2026-03-02  4:31 ` [PATCH 2/3] fwd, pif: Replace with pif_sock_l4() with pif_listen() David Gibson
2026-03-03 19:11   ` Stefano Brivio
2026-03-03 22:55     ` David Gibson
2026-03-05  0:38       ` Stefano Brivio
2026-03-02  4:31 ` [PATCH 3/3] clang-tidy: Don't insist on #ifdef over #if defined() David Gibson
2026-03-05  0:38   ` Stefano Brivio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260305013838.2314da66@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=jfiusdq@proton.me \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).