qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] tracetool: cast const types to avoid compile time warni


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] tracetool: cast const types to avoid compile time warnings
Date: Thu, 22 Mar 2012 08:28:49 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Mar 21, 2012 at 05:08:15PM +0000, Lee Essen wrote:
> On Solaris/Illumos dtrace will remove the "const" qualifier from any
> arguments when producing the header file, this results in hundreds
> of compile-time warnings.

I wonder why DTrace does this, it seems wrong.  If anything it should be
the other way around with all DTrace arguments becoming const :).  Will
you submit a patch to preserve const in upstream DTrace?

> I have put together a patch to tracetool to cast any const argument
> appropriately to remove the warnings, but I don't know how it
> behaves on any other dtrace platform. If the "const" isn't removed
> then this patch will actually create warnings.

Why would it introduce warnings, maybe I'm misunderstanding?

The following generated .h code should work without warnings whether
the DTRACE_FOO() is const char* or char*:

void trace_foo(const char *s)
{
    DTRACE_FOO((char *)s);
}

> Do you see these warnings on any other dtrace platform?  If not,
> then I'll need to make sure the patch is solaris-specific.

I haven't seen this issue on SystemTap.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]