This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libstdc++]: Avoid -Wcast-qual warnings in src/c++98/compatibility.cc
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Paolo Carlini <paolo dot carlini at oracle 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:41:56 +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> <20130814082909 dot GM1814 at tucnak dot redhat dot com>
On Wed, Aug 14, 2013 at 10:29 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>> >2013-08-07 Uros Bizjak <ubizjak@gmail.com>
>> >
>> > * 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[2] and similar
> and (void *) 1L etc. were left untouched.
These didn't emit warnings for my target (alpha), so also not being a
C++ person, I left them as they were.
Uros.