[PATCH 3/3] Get rid of const warnings in XSERVER_INPUT_EVENT dtrace probe calls

Alan Coopersmith alan.coopersmith at oracle.com
Tue Dec 23 19:53:43 PST 2014


On 12/19/14 06:15 PM, Keith Packard wrote:
> Alan Coopersmith <alan.coopersmith at oracle.com> writes:
>
>> dtrace generates these as taking non const arguments, so cast away
>> the constness of the pointers when calling them.
>
> I really don't like casting away const. I note that Xserver-dtrace.h.in
> is in git, so you could (?) add the const there instead?

Solaris doesn't use the file that's in git, but generates a new copy
during build time from the dtrace definitions.   (Other platforms use
that instead of generating a fresh copy from the definitions.)

Peter is NULL'ing out some of these once the merge window opens:
http://patchwork.freedesktop.org/patch/39059/

But after trying a few things, I've been able to solve the problem by using
typedefs of const pointers, since the dtrace header generator passes through
typedefs where it strips the const qualifiers.   New patch to follow.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list