Skip to content

Commit

Permalink
btrfs-progs: fix clang warning in array length calculation in print_h…
Browse files Browse the repository at this point in the history
…eader_info()

Clang 19.1.6 reports:

  kernel-shared/print-tree.c:1346:38: warning: variable length array
    folded to constant array as an extension [-Wgnu-folding-constant]
    1346 |         char csum_str[2 * BTRFS_CSUM_SIZE + strlen(" csum 0x") + 1];

Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
kdave committed Jan 17, 2025
1 parent 1e4a94d commit ff0a587
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel-shared/print-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ static void print_header_info(struct extent_buffer *eb, unsigned int mode)
u64 flags;
u32 nr;
u8 backref_rev;
char csum_str[2 * BTRFS_CSUM_SIZE + strlen(" csum 0x") + 1];
char csum_str[2 * BTRFS_CSUM_SIZE + 8 /* strlen(" csum 0x") */ + 1];
int i;
int csum_size = fs_info->csum_size;

Expand Down

0 comments on commit ff0a587

Please sign in to comment.