From 51149a2ac1ed962e04c48fe591f2b6b288755af6 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Mon, 27 Mar 2017 10:46:12 +0200 Subject: [PATCH] slirp: fix compilation errors with DEBUG set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit slirp/slirp.c: In function 'get_dns_addr_resolv_conf': slirp/slirp.c:202:29: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] char *res = inet_ntop(af, tmp_addr, s, sizeof(s)); ^~~~~~~~~ slirp/slirp.c:204:25: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] res = "(string conversion error)"; Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Thibault --- slirp/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/slirp.c b/slirp/slirp.c index 60539de7a3..5a94b06f5e 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -198,7 +198,7 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr, #ifdef DEBUG else { char s[INET6_ADDRSTRLEN]; - char *res = inet_ntop(af, tmp_addr, s, sizeof(s)); + const char *res = inet_ntop(af, tmp_addr, s, sizeof(s)); if (!res) { res = "(string conversion error)"; } -- 2.42.0