Subject: Re: -Wcast-qual and assignement to strucutres
To: None <tech-kern@NetBSD.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 02/18/2006 15:49:15
On Mon, Feb 13, 2006 at 01:33:53AM +0100, Manuel Bouyer wrote:
> Hi,
> I've a problem with -Wcast-qual: I have the following function:
>
> static int
> xs_talkv(struct xenbus_transaction *t,
> enum xsd_sockmsg_type type,
> const struct iovec *iovec,
> unsigned int num_vecs,
> unsigned int *len,
> char **retbuf);
> [...]
> static int
> xs_single(struct xenbus_transaction *t,
> enum xsd_sockmsg_type type,
> const char *string,
> unsigned int *len,
> char **ret)
> {
> struct iovec iovec;
>
> iovec.iov_base = string;
> iovec.iov_len = strlen(string) + 1;
> return xs_talkv(t, type, &iovec, 1, len, ret);
> }
>
> The compiler complains on iovec.iov_base = string:
Thanks for the replies. __UNCONST was what I was looking for (but I greped
the sources for unconst; should have used grep -i ...)
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--