Date: Tue, 22 May 2007 13:07:43 -0400 (EDT) From: Robert Watson <rwatson@FreeBSD.org> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, Warner Losh <imp@bsdimp.com>, bde@optusnet.com.au Subject: Re: cvs commit: src/lib/libmemstat memstat_malloc.c Message-ID: <20070522130612.A28780@fledge.watson.org> In-Reply-To: <13451.1179852986@critter.freebsd.dk> References: <13451.1179852986@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070522130612.A28780>