[PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI

Theodore Ts'o
2026-05-04T23:33:25Z

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.

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);
+ 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);
+}
+#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