cvs commit: src/lib/libmemstat memstat_malloc.c

Robert Watson rwatson at FreeBSD.org
Tue May 22 17:07:46 UTC 2007


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


More information about the cvs-all mailing list