From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Date: Wed, 13 Sep 2000 16:44:11 +0000 From: "Douglas A. Gwyn" Message-ID: <39BFADD3.A6B446C3@null.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <20000913143710.99FB9199E2@mail> Subject: Re: [9fans] no const? Topicbox-Message-UUID: 06f83ce8-eac9-11e9-9e20-41e7f4b1d025 forsyth@vitanuova.com wrote: > volatile: both too little and too much to be useful for the purpose for which it is touted > const: confuses the C type system but does not seriously add clarity or protection > (eg, char *strchr(const char *, int)) Those complaints are essentially the same: that the facility addresses some problems but not all related problems. This aspect was well understood when we adopted them for the first C standard in the 1980s, and the decision was based on getting some benefit some of the time rather than getting no benefit all of the time. Note that the new C standard adds restrict qualification for pointers, to allow optimizations that otherwise would not be safe. "restrict" can be ignored by the compiler, so long as it doesn't try to make those aggressive optimizations.