This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, libstdc++]: Avoid -Wcast-qual warnings in src/c++98/compatibility.cc


On Wed, Aug 14, 2013 at 4:36 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Wed, Aug 14, 2013 at 4:34 PM, Gabriel Dos Reis
> <gdr@integrable-solutions.net> wrote:
>> On Wed, Aug 14, 2013 at 9:22 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>
>>> On Wed, Aug 14, 2013 at 4:05 PM, Gabriel Dos Reis
>>> <gdr@integrable-solutions.net> wrote:
>>> > I agree 'const void*' is preferable, and all the places you mention should
>>> > be covered too.
>>>
>>> I already installed my original patch, so attached incremental patch
>>> implements preferred solution.
>>>
>>> 2013-08-14  Uros Bizjak  <ubizjak@gmail.com>
>>>
>>>         * src/c++98/compatibility.cc (_ZTIe): Use (const cast *)
>>>         to avoid -Wcast-qual warnings.
>>>         (_ZTIPe): Ditto.
>>>         (ZTIPKe): Ditto.
>>>
>>> Tested on alphaev68-pc-linux-gnu and installed on mainline SVN.
>>>
>>> Is this solution also OK for other release branches?
>>>
>>> Uros.
>>
>> Sorry, when I said 'const void*' was OK, I implicitly assumed that you would
>> use C++-style cast reinterpret_cast<const void*>(_Z….).  Same for
>> reinterpret_cast<const void*>(1);
>
> Ah, OK. I'll add this in a moment.

Like the attached patch?

Again, build tested on alphaev68-pc-linux-gnu.

Uros.

Attachment: l.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]