Subject: Re: toolchain/22118: make won't compile with -Wcast-qual -Wstrict-prototypes and more
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Greg A. Woods <woods@weird.com>
List: tech-toolchain
Date: 07/16/2003 16:43:08
[ On Wednesday, July 16, 2003 at 15:25:27 (-0400), der Mouse wrote: ]
> Subject: Re: toolchain/22118: make won't compile with -Wcast-qual -Wstrict-prototypes and more
>
> >> Ie.  there are standard api's out there that take char *, when they
> >> could/should take const char *.
> > The only one that has been revealed to date is
> > XCreatePixmapFromBitmapData()
> 
> That has been mentioned exactly once, in a message in which I also
> mentioned the iov_base field of struct iovec (as used by writev()) and
> similarly non-const fields of two other X structures.

The other examples are cases where a common complex type declaration is
used to define an object which may hold pointers to both data that could
be const qualified or pointers to data that must not be const qualified,
depending on their use.

I thought we had earlier agreed that all such APIs of this specific type
are broken w.r.t. strict use of the "const" qualifier, and that any
attempt to use "const" qualified storage in those APIs (such as string
constants) was at minimum doomed to be non-portable.

Your best choices when using these APIs are to either ignore the
warnings, don't enable the warnings, or use -fwritable-strings to
prevent the warnings (for at least string constants) even when they're
enabled.

Note too that those other examples are not of the type which started
this thread....

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>