WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] do_callback_op()'s second argument can be const

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] do_callback_op()'s second argument can be const
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 18 Jan 2008 15:05:47 +0000
Delivery-date: Fri, 18 Jan 2008 07:05:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C3B66F7C.1B060%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4790C784.76E4.0078.0@xxxxxxxxxx> <C3B66F7C.1B060%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> 18.01.08 16:00 >>>
>This patch doesn't seem very useful since the guest can trivially cast its
>way out of the const-ness.

Casts should be avoided if possible, especially in C (in C++ you could
indeed just cast away the constness without affecting the underlying
type). The hypervisor side of this change is to guarantee the constness
to the guest side is (to be, in a few seconds) promised by changes to
the hypercall wrappers.

>I certainly don't see how the chunk below fixes
>anything -- doesn't it take two lines to state what took one line before?

It fixes the build in the context of the other changes.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel