From owner-cvs-all@FreeBSD.ORG Tue May 22 17:07:45 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE2E616A478; Tue, 22 May 2007 17:07:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 76DBD13C469; Tue, 22 May 2007 17:07:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 0CB4B474E9; Tue, 22 May 2007 13:07:44 -0400 (EDT) Date: Tue, 22 May 2007 13:07:43 -0400 (EDT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Poul-Henning Kamp In-Reply-To: <13451.1179852986@critter.freebsd.dk> Message-ID: <20070522130612.A28780@fledge.watson.org> References: <13451.1179852986@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, Warner Losh , bde@optusnet.com.au Subject: Re: cvs commit: src/lib/libmemstat memstat_malloc.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2007 17:07:46 -0000 On Tue, 22 May 2007, Poul-Henning Kamp wrote: > C unfortunately lacks a syntax that can express suck subtle and non-subtle > nuances and recent standardization efforts have shown little interest in > offering more "intentional programming" facilities in C. > > Absent such progress and despite what the Zen master says, I think const is > a useful concept and that the occational well-thought out use of __DECONST() > can not only be fully justified but also recommended. Provided it is used > to improve the expression of deliberate intent, rather than to paste over > gottchas. I like const, but it necessarily requires incremental deployment on a code base. __DECONST allows use of const in new modules before dependent modules have been converted. To pull an arbitrary example out of an arbitrary hat: libkvm isn't const-poisoned, but libmemstat is. With the new gcc version, we now see a warning, which is silenced by marking the transition into libkvm with __DECONST. Robert N M Watson Computer Laboratory University of Cambridge