diff --git a/btrfs-image.c b/btrfs-image.c index b2c34d75..b05cf076 100644 --- a/btrfs-image.c +++ b/btrfs-image.c @@ -142,6 +142,7 @@ struct mdrestore_struct { struct btrfs_fs_info *info; }; +static void print_usage(void) __attribute__((noreturn)); static int search_for_chunk_blocks(struct mdrestore_struct *mdres, u64 search, u64 cluster_bytenr); static struct extent_buffer *alloc_dummy_eb(u64 bytenr, u32 size); diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index ea0a1ba5..51179a31 100644 --- a/btrfs-map-logical.c +++ b/btrfs-map-logical.c @@ -90,6 +90,7 @@ static struct extent_buffer * debug_read_block(struct btrfs_root *root, return eb; } +static void print_usage(void) __attribute__((noreturn)); static void print_usage(void) { fprintf(stderr, "usage: btrfs-map-logical [options] device\n"); diff --git a/btrfs-zero-log.c b/btrfs-zero-log.c index 31ec2158..432adff4 100644 --- a/btrfs-zero-log.c +++ b/btrfs-zero-log.c @@ -32,6 +32,7 @@ #include "version.h" #include "utils.h" +static void print_usage(void) __attribute__((noreturn)); static void print_usage(void) { fprintf(stderr, "usage: btrfs-zero-log dev\n"); diff --git a/commands.h b/commands.h index 0600a583..2e953860 100644 --- a/commands.h +++ b/commands.h @@ -72,12 +72,12 @@ int handle_command_group(const struct cmd_group *grp, int argc, /* help.c */ extern const char * const generic_cmd_help_usage[]; -void usage(const char * const *usagestr); +void usage(const char * const *usagestr) __attribute__((noreturn)); void usage_command(const struct cmd_struct *cmd, int full, int err); void usage_command_group(const struct cmd_group *grp, int all, int err); -void help_unknown_token(const char *arg, const struct cmd_group *grp); -void help_ambiguous_token(const char *arg, const struct cmd_group *grp); +void help_unknown_token(const char *arg, const struct cmd_group *grp) __attribute__((noreturn)); +void help_ambiguous_token(const char *arg, const struct cmd_group *grp) __attribute__((noreturn)); void help_command_group(const struct cmd_group *grp, int argc, char **argv); diff --git a/mkfs.c b/mkfs.c index f61b0c96..3ac00bae 100644 --- a/mkfs.c +++ b/mkfs.c @@ -264,6 +264,8 @@ static int create_data_reloc_tree(struct btrfs_trans_handle *trans, return 0; } + +static void print_usage(void) __attribute__((noreturn)); static void print_usage(void) { fprintf(stderr, "usage: mkfs.btrfs [options] dev [ dev ... ]\n"); @@ -286,6 +288,7 @@ static void print_usage(void) exit(1); } +static void print_version(void) __attribute__((noreturn)); static void print_version(void) { fprintf(stderr, "mkfs.btrfs, part of %s\n", BTRFS_BUILD_VERSION);