Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Wang Yugui <wangyugui@e16-tech.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: btrfs ASSERT() error when make C=1, but OK when make C=0
Date: Thu, 25 Dec 2025 09:33:25 +0800	[thread overview]
Message-ID: <20251225093324.B3F1.409509F4@e16-tech.com> (raw)
In-Reply-To: <20251222223701.F4A2.409509F4@e16-tech.com>

Hi

> Hi,
> 
> I noticed a lot of make C=1 error of btrfs ASSERT(),
> but make C=0 is OK.
> 
> block-group.c: note: in included file:
> zoned.h:417:9: error: Expected ) in function call
> zoned.h:417:9: error: got __VA_OPT__
> 
> static inline bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg)
> {
> L417:    ASSERT(btrfs_is_zoned(bg->fs_info));
>     return (bg->alloc_offset == bg->zone_capacity);
> }
> 
> Any help to fix it?

We can walk around this problem with the flowing patch.
It seems that sparse(make C=1) does yet not support __VA_OPT__.

diff --git a/fs/btrfs/messages.h b/fs/btrfs/messages.h
index dea30823d61a..8755a5bc7ece 100644
--- a/fs/btrfs/messages.h
+++ b/fs/btrfs/messages.h
@@ -111,7 +111,7 @@ static inline void verify_assert_printk_format(const char *fmt, ...) {
  * As ##__VA_ARGS__ cannot be at the beginning of the macro the __VA_OPT__ is needed
  * and supported since GCC 8 and Clang 12.
  */
-#define __REST_ARGS(_, ... ) __VA_OPT__(,) __VA_ARGS__
+#define __REST_ARGS(_, ... ) , ##__VA_ARGS__
 
 #if defined(CONFIG_CC_IS_CLANG) || GCC_VERSION >= 80000
 /*


Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2025/12/25


      parent reply	other threads:[~2025-12-25  1:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 14:37 btrfs ASSERT() error when make C=1, but OK when make C=0 Wang Yugui
2025-12-22 19:57 ` Qu Wenruo
2025-12-25  1:33 ` Wang Yugui [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=20251225093324.B3F1.409509F4@e16-tech.com \
    --to=wangyugui@e16-tech.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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