Subject: Re: __UNCONST(a)
To: Pavel Cahyna <pavel.cahyna@st.cuni.cz>
From: Christos Zoulas <christos@zoulas.com>
List: tech-userlevel
Date: 07/05/2004 17:10:42
On Jul 5, 2:20pm, pavel.cahyna@st.cuni.cz (Pavel Cahyna) wrote:
-- Subject: Re: __UNCONST(a)
| Hello,
|
| On Wed, 30 Jun 2004 12:21:42 +0000, Christos Zoulas wrote:
|
| > On Jun 30, 4:44pm, lukem@NetBSD.org (Luke Mewburn) wrote:
| > | Is this to work around gcc and/or lint being overly aggressive
| > | in enforcing "const"ness of a type? Or bugs in those tools?
| >
| > No, the tools do what they were asked for. Write strchr(),
| > and make it work without warnings setting WARNS=3... The problem
| > is const castaways are parts of the apis of functions such as
| > strchr(), strtol() etc:
|
| Why not implement strchr as a macro which returns const char * if the
| input is const char * and a non-const * if the input is non-const *?
That is a nice idea and it would work in this case, but there
are many other cases...
christos