From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI
Date: Mon, 4 May 2026 17:20:06 -0700 [thread overview]
Message-ID: <20260505002006.GE1101423@frogsfrogsfrogs> (raw)
In-Reply-To: <20260504233301.2345652-5-tytso@mit.edu>
On Mon, May 04, 2026 at 07:32:58PM -0400, Theodore Ts'o wrote:
> fuse[24]fs.c defines some functions which might or might not be used
> depending on the version of the fuse library installed on the system.
> Unfortunately while gcc won't complain if there are static inline
> functions which are not used, clang will only suppress such complaints
> if the static inline functions are in a header file.
<groan>
> Since the github CI runs a test build with -Wall -Werror this was
> breaking the CI build.
>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
> fuse4fs/fuse4fs.c | 21 +++++++++++++++++++++
> misc/fuse2fs.c | 21 +++++++++++++++++++++
> 2 files changed, 42 insertions(+)
>
> diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
> index 13e1aae4b..b883083f8 100644
> --- a/fuse4fs/fuse4fs.c
> +++ b/fuse4fs/fuse4fs.c
> @@ -502,6 +502,27 @@ static inline off_t FUSE4FS_FSB_TO_B(const struct fuse4fs *ff, blk64_t bno)
> return bno << ff->blocklog;
> }
>
> +#ifdef __clang__
> +#define SUPPRESS_UNUSED_FUNCTION(func) (void)func
> +/*
> + * These functions might or might not be used depending on the version
> + * of the fuse library installed on the system. Unfortunately while
> + * gcc won't complain if there are static inline functions which are
> + * not used, clang will only suppress such complaints if the static
> + * inline functions are in a header file.
> + */
> +void fuse2fs_shut_up_stupid_clang_warnings(void)
> +{
> + SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);
Why is this stupid recursive shi ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
even necessary?
> + SUPPRESS_UNUSED_FUNCTION(round_up);
> + SUPPRESS_UNUSED_FUNCTION(round_down);
> + SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSBT);
> + SUPPRESS_UNUSED_FUNCTION(FUSE4FS_OFF_IN_FSB);
> + SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSB);
> + SUPPRESS_UNUSED_FUNCTION(FUSE4FS_FSB_TO_B);
Hrmm some of these aren't strictly necessary, but ... oh. The first
three are actively used in the punch hole helpers, but that only applies
on a platform that *supports* hole punching. So my guess is that these
clang warnings appear on macos, where there isn't holepunching?
--D
> +}
> +#endif
> +
> static double gettime_monotonic(void)
> {
> #ifdef CLOCK_MONOTONIC
> diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
> index 0f4781bc4..c46cfc236 100644
> --- a/misc/fuse2fs.c
> +++ b/misc/fuse2fs.c
> @@ -339,6 +339,27 @@ static inline off_t FUSE2FS_FSB_TO_B(const struct fuse2fs *ff, blk64_t bno)
> return bno << ff->blocklog;
> }
>
> +#ifdef __clang__
> +#define SUPPRESS_UNUSED_FUNCTION(func) (void)func
> +/*
> + * These functions might or might not be used depending on the version
> + * of the fuse library installed on the system. Unfortunately while
> + * gcc won't complain if there are static inline functions which are
> + * not used, clang will only suppress such complaints if the static
> + * inline functions are in a header file.
> + */
> +void fuse2fs_shut_up_stupid_clang_warnings(void)
> +{
> + SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);
> + SUPPRESS_UNUSED_FUNCTION(round_up);
> + SUPPRESS_UNUSED_FUNCTION(round_down);
> + SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSBT);
> + SUPPRESS_UNUSED_FUNCTION(FUSE2FS_OFF_IN_FSB);
> + SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSB);
> + SUPPRESS_UNUSED_FUNCTION(FUSE2FS_FSB_TO_B);
> +}
> +#endif
> +
> static double gettime_monotonic(void)
> {
> #ifdef CLOCK_MONOTONIC
> --
> 2.53.0
>
>
next prev parent reply other threads:[~2026-05-05 0:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 23:32 [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Theodore Ts'o
2026-05-04 23:32 ` [PATCH 1/7] libsupport: drop xbitops.h and define fls() if necessary Theodore Ts'o
2026-05-05 0:11 ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 2/7] configure.ac: fix disable fuse2fs/fuse4fs by default path Theodore Ts'o
2026-05-05 0:13 ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 3/7] libsupport: don't use bzero in cache.c Theodore Ts'o
2026-05-05 0:15 ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI Theodore Ts'o
2026-05-05 0:20 ` Darrick J. Wong [this message]
2026-05-04 23:32 ` [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h Theodore Ts'o
2026-05-05 0:20 ` Darrick J. Wong
2026-05-04 23:33 ` [PATCH 6/7] libsupport: fix gcc -Wall warnings Theodore Ts'o
2026-05-05 0:20 ` Darrick J. Wong
2026-05-04 23:33 ` [PATCH 7/7] fuse2fs: fix uninitialized variable warnings Theodore Ts'o
2026-05-05 0:26 ` Darrick J. Wong
2026-05-05 0:08 ` [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Darrick J. Wong
2026-05-05 7:21 ` Theodore Tso
2026-05-05 15:58 ` Darrick J. Wong
2026-05-05 22:04 ` Theodore Tso
2026-05-05 22:56 ` Darrick J. Wong
2026-05-06 9:28 ` Theodore Tso
2026-05-06 14:34 ` Darrick J. Wong
2026-05-06 15:08 ` Theodore Tso
2026-05-06 16:39 ` Darrick J. Wong
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=20260505002006.GE1101423@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.