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] Add -Wcast-qual flag

To: "Keir Fraser" <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Add -Wcast-qual flag
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 21 Dec 2006 14:18:32 +0000
Cc: Christoph Egger <Christoph.Egger@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 21 Dec 2006 06:17:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1B03C6A.6B25%keir@xxxxxxxxxxxxx>
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: <458A915B.76E4.0078.0@xxxxxxxxxx> <C1B03C6A.6B25%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> Keir Fraser <keir@xxxxxxxxxxxxx> 21.12.06 14:28 >>>
>On 21/12/06 12:51, "Jan Beulich" <jbeulich@xxxxxxxxxx> wrote:
>
>> While I'd really like to see all Xen code become const-correct (because I do
>> believe this helps with code quality, like does marking read only data read
>> only in the page tables), I don't think adding the warning here is
>> appropriate - after all, in C this is one of the purposes of adding explicit
>> casts (although I agree it's questionable to use casts for this purpose).
>> And no, I don't think that many people screwing up const placement is a
>> proper argument for not using const where possible.
>
>Well, I'm inclined to take the clean-up parts of the patches but leave out
>__UNCONST() and -Wcast-qual. I really dislike the compiler thinking it knows
>better than an explicit cast, and casting via unsigned long is just a
>kludge.

This I completely agree with.

Jan

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