From: Rudi Heitbaum Date: Fri, 3 Apr 2026 05:28:00 +0000 (+0000) Subject: fix: resolve -Wdiscarded-qualifiers warnings in ifconfig_route and complete_config X-Git-Url: https://www.tinc-vpn.org/git/?a=commitdiff_plain;h=3ae8fd111bc2390417661e09c18a6aec4d5e729f;p=tinc fix: resolve -Wdiscarded-qualifiers warnings in ifconfig_route and complete_config In ifconfig_route, remove const from the value parameter as it is written through via sep (*sep++ = 0) and is only called from finalize_join() with a mutable buffer. In complete_config, change dot to const char* as it is only used for pointer arithmetic and reading, never written through. Signed-off-by: Rudi Heitbaum --- diff --git a/src/ifconfig.c b/src/ifconfig.c index 9913b815..9bf59d4d 100644 --- a/src/ifconfig.c +++ b/src/ifconfig.c @@ -178,7 +178,7 @@ void ifconfig_address(FILE *out, const char *value) { #endif } -void ifconfig_route(FILE *out, const char *value) { +void ifconfig_route(FILE *out, char *value) { subnet_t subnet = {0}, gateway = {0}; char subnet_str[MAXNETSTR] = "", gateway_str[MAXNETSTR] = ""; char *sep = strchr(value, ' '); diff --git a/src/ifconfig.h b/src/ifconfig.h index 52fcc26b..7d0afabc 100644 --- a/src/ifconfig.h +++ b/src/ifconfig.h @@ -26,7 +26,7 @@ extern void ifconfig_dhcp(FILE *out); extern void ifconfig_dhcp6(FILE *out); extern void ifconfig_slaac(FILE *out); extern void ifconfig_address(FILE *out, const char *value); -extern void ifconfig_route(FILE *out, const char *value); +extern void ifconfig_route(FILE *out, char *value); extern void ifconfig_header(FILE *out); extern bool ifconfig_footer(FILE *out); diff --git a/src/tincctl.c b/src/tincctl.c index 914eae7b..ab5a2b24 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -3098,7 +3098,7 @@ static char *complete_config(const char *text, int state) { } while(variables[i].name) { - char *dot = strchr(text, '.'); + const char *dot = strchr(text, '.'); if(dot) { if((variables[i].type & VAR_HOST) && !strncasecmp(variables[i].name, dot + 1, strlen(dot + 1))) {