mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user