From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christoph Egger" Subject: Re: [PATCH] Add -Wcast-qual flag Date: Thu, 21 Dec 2006 14:25:52 +0100 Message-ID: <200612211425.53099.Christoph.Egger@amd.com> References: <200612211105.21248.Christoph.Egger@amd.com> <458A915B.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <458A915B.76E4.0078.0@novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org On Thursday 21 December 2006 13:51, Jan Beulich wrote: > >>> Keir Fraser 21.12.06 11:41 >>> > > > >On 21/12/06 10:05, "Christoph Egger" wrote: > >> The xen-cast.diff adds the -Wcast-qual flag. > > > >We don't enable this flag precisely because we end up needing to scatter > >const all over the place like confetti. I'm not convinced that use of > > const improves code quality. I fear we'd end up with 'const foo * const > > bar' all over the place -- ugly and confusing to most programmers (who > > frequently mess up const placement, in my experience). > > 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 IMO, it is. It is one step towards to do more type-safe coding. > - 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. Full ack. Christoph