Get rid of gcc 7 "fall through" warnings

With gcc 7 we get warnings like the following:

 fdasd.c: In function 'main':
 fdasd.c:3055:4: warning: this statement may fall through
                          [-Wimplicit-fallthrough=]
     fdasd_exit(&anchor, 0);
     ^~~~~~~~~~~~~~~~~~~~~~
 fdasd.c:3056:3: note: here
    default:
    ^~~~~~~

Fix this by marking functions with "__noreturn" to help gcc.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
This commit is contained in:
Michael Holzheu
2017-09-05 15:52:54 +02:00
parent 6c3c721275
commit 221e74c27c
12 changed files with 21 additions and 19 deletions

View File

@@ -71,8 +71,8 @@ static const struct tool_info iucv_tool[2] = {
};
static void usage_exit(const struct tool_info *prg, int is_error,
const char *msg)
static void __noreturn usage_exit(const struct tool_info *prg, int is_error,
const char *msg)
{
if (msg != NULL)
fprintf(stderr, _("%s: %s\n"), prg->name, msg);
@@ -80,7 +80,7 @@ static void usage_exit(const struct tool_info *prg, int is_error,
exit(is_error ? 1 : 0); /* rc=1 .. invalid args */
}
static void version_exit(const struct tool_info *prg)
static void __noreturn version_exit(const struct tool_info *prg)
{
printf(_("%s: IUCV Terminal Applications, version %s\n"),
prg->name, RELEASE_STRING);

View File

@@ -62,13 +62,13 @@ static const char usage[] =
"-h, --help Displays this help, then exits.\n"
"-v, --version Displays version information, then exits.\n";
static void help_exit(const char *prg)
static void __noreturn help_exit(const char *prg)
{
printf(usage, prg, prg);
exit(EXIT_SUCCESS);
}
static void version_exit(const char *prg)
static void __noreturn version_exit(const char *prg)
{
printf("%s: Start a program if a terminal device is available, "
"version %s\n", prg, RELEASE_STRING);