From 5da34a80371a337acc73eff30d894cc1c513a519 Mon Sep 17 00:00:00 2001 From: Quentin Kaiser Date: Fri, 9 Feb 2024 11:06:03 +0100 Subject: [PATCH] chore: fix modern clang errors. Unused variable ext_written was reported by -Wunused-but-set-variable, so it's now guarded by the same preprocessor guards that protects its actual usage. Function without prototypes are note allowed in C23. --- e2fsck/extents.c | 9 ++++++++- lib/ss/test_ss.c | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/e2fsck/extents.c b/e2fsck/extents.c index 70798f346..9747d4088 100644 --- a/e2fsck/extents.c +++ b/e2fsck/extents.c @@ -201,9 +201,12 @@ static errcode_t rewrite_extent_replay(e2fsck_t ctx, struct extent_list *list, { errcode_t retval; ext2_extent_handle_t handle; - unsigned int i, ext_written; + unsigned int i; struct ext2fs_extent *ex, extent; blk64_t start_val, delta; + #if defined(DEBUG) || defined(DEBUG_SUMMARY) + unsigned int ext_written; + #endif /* Reset extent tree */ inode->i_flags &= ~EXT4_EXTENTS_FL; @@ -223,7 +226,9 @@ static errcode_t rewrite_extent_replay(e2fsck_t ctx, struct extent_list *list, if (retval) return retval; + #if defined(DEBUG) || defined(DEBUG_SUMMARY) ext_written = 0; + #endif start_val = ext2fs_get_stat_i_blocks(ctx->fs, EXT2_INODE(inode)); @@ -263,7 +268,9 @@ static errcode_t rewrite_extent_replay(e2fsck_t ctx, struct extent_list *list, retval = ext2fs_extent_fix_parents(handle); if (retval) goto err; + #if defined(DEBUG) || defined(DEBUG_SUMMARY) ext_written++; + #endif } delta = ext2fs_get_stat_i_blocks(ctx->fs, EXT2_INODE(inode)) - diff --git a/lib/ss/test_ss.c b/lib/ss/test_ss.c index 53ca99fc4..12f8087a8 100644 --- a/lib/ss/test_ss.c +++ b/lib/ss/test_ss.c @@ -136,9 +136,7 @@ int main(int argc, char **argv) } -void test_cmd (argc, argv) - int argc; - char **argv; +void test_cmd (int argc, char** argv) { printf("Hello, world!\n"); printf("Args: ");