public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, llvm@lists.linux.dev,
	patches@lists.linux.dev
Subject: Re: [PATCH] btrfs: Fix use of GCC_VERSION in messages.h
Date: Tue, 29 Apr 2025 08:38:00 +0200	[thread overview]
Message-ID: <20250429063800.GA18094@suse.cz> (raw)
In-Reply-To: <20250428-btrfs-fix-messages-h-clang-v1-1-5ede51586a9c@kernel.org>

On Mon, Apr 28, 2025 at 03:01:35PM -0700, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y):
> 
>   fs/btrfs/messages.h:188:5: error: 'GCC_VERSION' is not defined, evaluates to 0 [-Werror,-Wundef]
>     188 | #if GCC_VERSION >= 80000
>         |     ^
> 
> GCC_VERSION is defined in compiler-gcc.h, which is not included when
> building with clang. Use the always defined Kconfig symbol,
> CONFIG_GCC_VERSION, to do the comparison.
> 
> Additionally, as a comment above this #ifdef notes, clang supports
> __VA_OPT__, which is really what is needed for this block to function.
> Include a check for CONFIG_CC_IS_CLANG as well, since clang 13 is the
> minimum supported version for building the kernel.
> 
> Fixes: 14d740332aa0 ("btrfs: enhance ASSERT() to take optional format string")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks, back then I verified that the minimum clang version required for
kernel compiles the code and using just GCC_VERSION looked correct from
other code but apparently not. Folded to the patch, thanks.

      reply	other threads:[~2025-04-29  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 22:01 [PATCH] btrfs: Fix use of GCC_VERSION in messages.h Nathan Chancellor
2025-04-29  6:38 ` David Sterba [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=20250429063800.GA18094@suse.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=patches@lists.linux.dev \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox