btrfs-progs: utils: Replace __attribute__(fallthrough)

When compiling with clang, this warning is shown:

common/utils.c:404:3: warning: declaration does not declare anything [-Wmissing-declarations]
                __attribute__ ((fallthrough));

This attribute seems to silence the same warning in GCC. Changing this
attribute with /* fallthrough */ fixes the warning for both gcc and
clang.

Full support for the attribute will be in clang 10, gcc supports that
now. Let's use what works for both and switch to the attribute in the
future.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Marcos Paulo de Souza 2019-10-21 23:02:27 -03:00 committed by David Sterba
parent e33a73b754
commit 575b6e0e51
1 changed files with 6 additions and 6 deletions

View File

@ -401,15 +401,15 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, unsigned unit_mod
case UNITS_TBYTES:
base *= mult;
num_divs++;
__attribute__ ((fallthrough));
/* fallthrough */
case UNITS_GBYTES:
base *= mult;
num_divs++;
__attribute__ ((fallthrough));
/* fallthrough */
case UNITS_MBYTES:
base *= mult;
num_divs++;
__attribute__ ((fallthrough));
/* fallthrough */
case UNITS_KBYTES:
num_divs++;
break;
@ -1135,14 +1135,14 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
default:
case 4:
allowed |= BTRFS_BLOCK_GROUP_RAID10;
__attribute__ ((fallthrough));
/* fallthrough */
case 3:
allowed |= BTRFS_BLOCK_GROUP_RAID6;
__attribute__ ((fallthrough));
/* fallthrough */
case 2:
allowed |= BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
BTRFS_BLOCK_GROUP_RAID5;
__attribute__ ((fallthrough));
/* fallthrough */
case 1:
allowed |= BTRFS_BLOCK_GROUP_DUP;
}