diff options
author | Russ Allbery <eagle@eyrie.org> | 2018-04-22 20:50:00 -0700 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2018-04-22 20:50:00 -0700 |
commit | 9b8536991719cab3b8636f3b7c924d5bbe37d28a (patch) | |
tree | bd57e1ed38516bbb8eec2df8dd8c17a6ae15f0aa /server | |
parent | 3f59a8928f819a034f9c69826fc67305be0546e3 (diff) |
Fix warnings under Clang
Flesh out support for Clang warnings and compile cleanly under Clang
with most warnings enabled (-Weverything with some exclusions).
Diffstat (limited to 'server')
-rw-r--r-- | server/config.c | 2 | ||||
-rw-r--r-- | server/internal.h | 3 | ||||
-rw-r--r-- | server/remctl-shell.c | 7 | ||||
-rw-r--r-- | server/remctld.c | 5 |
4 files changed, 6 insertions, 11 deletions
diff --git a/server/config.c b/server/config.c index 9157c3e..ebfc717 100644 --- a/server/config.c +++ b/server/config.c @@ -770,8 +770,8 @@ acl_check_deny(const struct client *client, const char *data, case CONFIG_NOMATCH: return CONFIG_NOMATCH; case CONFIG_DENY: return CONFIG_NOMATCH; case CONFIG_ERROR: return CONFIG_ERROR; - default: return s; } + return s; } diff --git a/server/internal.h b/server/internal.h index bf210ef..1c36b0b 100644 --- a/server/internal.h +++ b/server/internal.h @@ -190,7 +190,8 @@ struct iovec **server_ssh_parse_command(const char *); /* libevent utility functions. */ void server_event_log_callback(int, const char *); -void server_event_fatal_callback(int); +void server_event_fatal_callback(int) + __attribute__((__noreturn__)); END_DECLS diff --git a/server/remctl-shell.c b/server/remctl-shell.c index efc26ac..ea06549 100644 --- a/server/remctl-shell.c +++ b/server/remctl-shell.c @@ -9,7 +9,7 @@ * This file handles parsing of the user's command and the main control flow. * * Written by Russ Allbery - * Copyright 2016 Russ Allbery <eagle@eyrie.org> + * Copyright 2016, 2018 Russ Allbery <eagle@eyrie.org> * Copyright 2016 Dropbox, Inc. * * See LICENSE for licensing terms. @@ -50,7 +50,7 @@ Supported ACL methods: file, princ, deny"; /* * Display the usage message for remctl-shell. */ -static void +static void __attribute__((__noreturn__)) usage(int status) { FILE *output; @@ -125,7 +125,6 @@ main(int argc, char *argv[]) break; case 'h': usage(0); - break; case 'q': quiet = true; break; @@ -135,11 +134,9 @@ main(int argc, char *argv[]) case 'v': printf("remctl-shell %s\n", PACKAGE_VERSION); exit(0); - break; default: warn("unknown option -%c", optopt); usage(1); - break; } } argc -= optind; diff --git a/server/remctld.c b/server/remctld.c index 59f5b41..9107169 100644 --- a/server/remctld.c +++ b/server/remctld.c @@ -90,7 +90,7 @@ struct options { /* * Display the usage message for remctld. */ -static void +static void __attribute__((__noreturn__)) usage(int status) { FILE *output; @@ -553,7 +553,6 @@ main(int argc, char *argv[]) break; case 'h': usage(0); - break; case 'k': if (setenv("KRB5_KTNAME", optarg, 1) < 0) sysdie("cannot set KRB5_KTNAME"); @@ -579,13 +578,11 @@ main(int argc, char *argv[]) case 'v': printf("remctld %s\n", PACKAGE_VERSION); exit(0); - break; case 'Z': options.suspend = true; break; default: usage(1); - break; } } |