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/12/2003 07:32:18
>>> [...], but the only portable alternative is to qualify the
>>> parameter as const (and hope it really won't be modified! ;-).
>> What parameter?
> The parameter (or return value) which the compiler is complaining
> causes the 'const' qualifier to be discarded, of course.  (thus the
> reaons some folks call it "const poisoning" :-)

Who says any function is involved?  Parameters and return values are
things related to functions.  Many of the times I want deconsting are
for assignments, typically to structs that are part of externally
defined interfaces (obviously, not designed for const-poisoned use).
The struct iovec used by readv()/writev() is an example: the compiler
warning occurs on the assignment to iov_base, nowhere near the call to
readv()/writev().  Another is the res_name and res_class fields in X
class hints.

/~\ 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