From: Vladimír Čunát Date: Mon, 30 Sep 2019 10:52:20 +0000 (+0200) Subject: conf nitpick: avoid warnings from clang >= 8 X-Git-Tag: v2.9.0~55^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc2696993f2e80a476cbbbd05bb9e893078efb96;p=thirdparty%2Fknot-dns.git conf nitpick: avoid warnings from clang >= 8 adding 'int' to a string does not append to the string [-Wstring-plus-int] It was only triggered on string literals, but I applied it to other ocurrences on the same lines for better uniformity. Tested with clang 9.0.0 - no warnings shown for me anymore. --- diff --git a/src/knot/conf/base.c b/src/knot/conf/base.c index e994839397..de4bc6b4d5 100644 --- a/src/knot/conf/base.c +++ b/src/knot/conf/base.c @@ -928,7 +928,7 @@ int conf_export( } // Export module sections before the template section. - if (strcmp(item->name + 1, C_TPL + 1) == 0) { + if (strcmp(&item->name[1], &C_TPL[1]) == 0) { for (yp_item_t *mod = item + 1; mod->name != NULL; mod++) { // Skip non-module sections. if (strncmp(mod->name + 1, mod_prefix, mod_prefix_len) != 0) { diff --git a/src/knot/conf/conf.c b/src/knot/conf/conf.c index 7a3c8d5b95..82a95a9a81 100644 --- a/src/knot/conf/conf.c +++ b/src/knot/conf/conf.c @@ -175,7 +175,7 @@ conf_val_t conf_zone_get_txn( return val; default: CONF_LOG_ZONE(LOG_ERR, dname, "failed to read '%s/%s' (%s)", - C_ZONE + 1, key1_name + 1, knot_strerror(val.code)); + &C_ZONE[1], &key1_name[1], knot_strerror(val.code)); // FALLTHROUGH case KNOT_ENOENT: break; @@ -191,7 +191,7 @@ conf_val_t conf_zone_get_txn( break; default: CONF_LOG_ZONE(LOG_ERR, dname, "failed to read '%s/%s' (%s)", - C_ZONE + 1, C_TPL + 1, knot_strerror(val.code)); + &C_ZONE[1], &C_TPL[1], knot_strerror(val.code)); // FALLTHROUGH case KNOT_ENOENT: case KNOT_YP_EINVAL_ID: @@ -203,7 +203,7 @@ conf_val_t conf_zone_get_txn( switch (val.code) { default: CONF_LOG_ZONE(LOG_ERR, dname, "failed to read '%s/%s' (%s)", - C_TPL + 1, key1_name + 1, knot_strerror(val.code)); + &C_TPL[1], &key1_name[1], knot_strerror(val.code)); // FALLTHROUGH case KNOT_EOK: case KNOT_ENOENT: @@ -232,7 +232,7 @@ conf_val_t conf_default_get_txn( switch (val.code) { default: CONF_LOG(LOG_ERR, "failed to read default '%s/%s' (%s)", - C_TPL + 1, key1_name + 1, knot_strerror(val.code)); + &C_TPL[1], &key1_name[1], knot_strerror(val.code)); // FALLTHROUGH case KNOT_EOK: case KNOT_ENOENT: diff --git a/src/knot/conf/tools.c b/src/knot/conf/tools.c index 714fbc8ee2..8000b53381 100644 --- a/src/knot/conf/tools.c +++ b/src/knot/conf/tools.c @@ -425,7 +425,7 @@ int check_template( if (val.code == KNOT_EOK) { \ CONF_LOG(LOG_NOTICE, "option 'template.%s' is obsolete, " \ "use option 'database.%s' instead", \ - old_item + 1, new_item + 1); \ + &old_item[1], &new_item[1]); \ }