qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] slirp: fix compilation errors with DEBUG set
@ 2017-03-27  8:46 Laurent Vivier
  2017-03-27 14:44 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2017-03-27  8:46 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: qemu-devel, Laurent Vivier

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 <laurent@vivier.eu>
---
 slirp/slirp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slirp/slirp.c b/slirp/slirp.c
index 60539de..5a94b06 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.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] slirp: fix compilation errors with DEBUG set
  2017-03-27  8:46 [Qemu-devel] [PATCH] slirp: fix compilation errors with DEBUG set Laurent Vivier
@ 2017-03-27 14:44 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-03-27 14:44 UTC (permalink / raw)
  To: Laurent Vivier, Samuel Thibault; +Cc: qemu-devel

On 03/27/2017 05:46 AM, Laurent Vivier wrote:
> 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 <laurent@vivier.eu>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  slirp/slirp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/slirp/slirp.c b/slirp/slirp.c
> index 60539de..5a94b06 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)";
>                  }
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-27 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-27  8:46 [Qemu-devel] [PATCH] slirp: fix compilation errors with DEBUG set Laurent Vivier
2017-03-27 14:44 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).