This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, libstdc++]: Avoid -Wcast-qual warnings in src/c++98/compatibility.cc
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org
- Date: Wed, 14 Aug 2013 10:29:09 +0200
- Subject: Re: [PATCH, libstdc++]: Avoid -Wcast-qual warnings in src/c++98/compatibility.cc
- References: <CAFULd4b1wMYmGosnnoCR_f3-hTjc2g0V1PAVKKCwzpEjLcQ1=Q at mail dot gmail dot com> <5202C08B dot 7060002 at oracle dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Aug 07, 2013 at 11:47:55PM +0200, Paolo Carlini wrote:
> On 08/07/2013 10:48 PM, Uros Bizjak wrote:
> >2013-08-07 Uros Bizjak <firstname.lastname@example.org>
> > * src/c++98/compatibility.cc (_ZTIe): Use const_cast to avoid warning.
> > (_ZTIPe): Ditto.
> > (ZTIPKe): Ditto.
> >The patch was bootstrapped on alpha-linux-gnu, regression test is still running.
> >OK for mainline if regtest shows no problems? Also for 4.8?
> I think you want in any case Jakub to have a look.
Changing all those (void *) casts into (const void *) in the _ZTIe,
_ZTIPe and _ZTIPKe initializers seems to also work. I'm not really a C++
guy, so I'll leave whether (const void *) or const_cast should be used
to libstdc++ maintainers. I'm just surprised you haven't changed
all the spots, just some of them, and
(void *) &_ZTVN10__cxxabiv123__fundamental_type_infoE and similar
and (void *) 1L etc. were left untouched.