On Sat, Feb 18, 2012 at 05:21:24PM +0000, Jon TURNEY wrote:
> Casting a (const char *) to (caddr_t) to assign to iovec.io_base
> seems pointless. caddr_t isn't used anywhere else in xcb or libX11

According to the libxcb git history, I replaced (caddr_t) with (char *)
in 2006 to "help DragonFly and Solaris". I'd be fine with this patch if
it explicitly cast to (char *), which I believe suppresses the constness
warning.

> Note: there's a warning about dropping constness here, but that's
> going to be unfixable as long as xcb_writev() takes a non-const struct
> iovec as a parameter.

C's rules regarding const always confuse me, but I'm pretty sure even
that wouldn't help. If the struct iovec is declared const, that just
means XCB won't change where the iov_base pointers point. It doesn't
mean XCB promises to refrain from writing through those pointers.

Jamey

Attachment: signature.asc
Description: Digital signature

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to