Subject: Re: toolchain/22118: make won't compile with -Wcast-qual -Wstrict-prototypes and more
To: NetBSD Toolchain Technical Discussion List <tech-toolchain@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-toolchain
Date: 07/14/2003 20:28:03
> In fact I'm not aware of any standard API that mis-uses 'const' in
> that way, but if you can show one then maybe we can get it fixed
> properly.

I'm not sure whether these will qualify, but they are places I find in
a quick look where I find myself commonly using deconst().

writev() (the same struct iovec is used for readv()).

The XClassHint structure ("res_name" and "res_class" fields).

The XTextProperty structure ("value" field).

The third arg to XCreatePixmapFromBitmapData().

>> Because data areas can become const (ie are not changed once they
>> have been initialised)

This is not what "const" means.  "const" does not mean "data will not
change"; it means "data is not changed through this access path".

It is not an attribute of the data, but an attribute of the pathway by
which it is accessed.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B