GCC 7: Add __attribute__((noreturn)) to some usage functions which call exit.

This happens with GCC 7.0.1.  The errors were all of the form:

qemu-speed-test.c: In function 'main':
qemu-speed-test.c:153:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
       usage (EXIT_SUCCESS);
       ^~~~~~~~~~~~~~~~~~~~
qemu-speed-test.c:155:5: note: here
     default:
     ^~~~~~~
This commit is contained in:
Richard W.M. Jones
2017-02-14 14:51:39 +00:00
parent 39daa04181
commit 0b3a5a0b00
5 changed files with 5 additions and 5 deletions

View File

@@ -38,7 +38,7 @@
extern int do_parse (struct parse_context *context, FILE *in);
static void
static void __attribute__((noreturn))
usage (int exit_status)
{
printf ("%s index\n", getprogname ());

View File

@@ -88,7 +88,7 @@ static void print_longest_to_shortest (void);
static void free_pass_data (void);
static void free_final_timeline (void);
static void
static void __attribute__((noreturn))
usage (int exitcode)
{
guestfs_h *g;

View File

@@ -51,7 +51,7 @@ static void run_test (void);
static guestfs_h *create_handle (void);
static void add_drive (guestfs_h *g);
static void
static void __attribute__((noreturn))
usage (int exitcode)
{
guestfs_h *g;

View File

@@ -74,7 +74,7 @@ static void run_test (size_t P);
static void *start_thread (void *thread_data_vp);
static void message_callback (guestfs_h *g, void *opaque, uint64_t event, int event_handle, int flags, const char *buf, size_t buf_len, const uint64_t *array, size_t array_len);
static void
static void __attribute__((noreturn))
usage (int exitcode)
{
fprintf (stderr,

View File

@@ -66,7 +66,7 @@ reset_default_tests (int *flag)
}
}
static void
static void __attribute__((noreturn))
usage (int exitcode)
{
fprintf (stderr,