summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-06-06 17:13:12 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-06-06 12:27:52 +0200
commit60091993a92cb3076ed1bc0a18141d79e2984adf (patch)
tree0cd7a35afe0f68bec94c4dcfd0ac50ce023ac8bb
parent2b3df1963c0070f4f092055fd0aa9f5b1e515ce9 (diff)
downloadsystemd-60091993a92cb3076ed1bc0a18141d79e2984adf.tar.gz
locale: add _unused_ attribute for dummy variable
This suppresses the following warning by clang: ``` [588/1179] Compiling C object 'systemd-localed@exe/src_locale_localed.c.o'. ../src/locale/localed.c:271:39: warning: unused variable 'dummy' [-Wunused-variable] _cleanup_(locale_free) char **dummy = new_locale; ^ ```
-rw-r--r--src/locale/localed.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/locale/localed.c b/src/locale/localed.c
index d4835eb0a1..0b4da63cf0 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -267,11 +267,10 @@ static void locale_free(char ***l) {
static int method_set_locale(sd_bus_message *m, void *userdata, sd_bus_error *error) {
Context *c = userdata;
_cleanup_strv_free_ char **settings = NULL, **l = NULL;
- char *new_locale[_VARIABLE_LC_MAX] = {};
- _cleanup_(locale_free) char **dummy = new_locale;
+ char *new_locale[_VARIABLE_LC_MAX] = {}, **i;
+ _cleanup_(locale_free) _unused_ char **dummy = new_locale;
bool modified = false;
int interactive, p, r;
- char **i;
assert(m);
assert(c);