This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH c++ 06/12] Fix constness problem in ioscm_make_gdb_stdio_port
- From: Doug Evans <xdje42 at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 26 Oct 2015 11:36:23 -0700
- Subject: Re: [PATCH c++ 06/12] Fix constness problem in ioscm_make_gdb_stdio_port
- Authentication-results: sourceware.org; auth=none
- References: <1445831204-16588-1-git-send-email-simon dot marchi at polymtl dot ca> <1445831204-16588-6-git-send-email-simon dot marchi at polymtl dot ca> <562E5050 dot 6010909 at redhat dot com> <CAFXXi0mDYRDkMegxy9KgvtezjFdz+Btr6kHFa44m4Sp6vybquw at mail dot gmail dot com> <562E6543 dot 7040509 at redhat dot com>
On Mon, Oct 26, 2015 at 10:39 AM, Pedro Alves <palves@redhat.com> wrote:
> On 10/26/2015 05:27 PM, Simon Marchi wrote:
>> On 26 October 2015 at 12:09, Pedro Alves <palves@redhat.com> wrote:
>>> WDYT?
>>
>> Sounds good to me. I wanted to avoid passing a string literal to
>> something that wasn't explicitely const (since if it tries to modify
>> the string, the program just crashes). But if we are sure that
>> scm_mode_bits does not do that, we can keep the simpler code.
>>
>> Here's a ready to push patch (not guaranteed to be well-formatted,
>> because gmail).
>>
>>
>> From ff3fa55ca1cf6bd23de87eb26687ad48fb2b3806 Mon Sep 17 00:00:00 2001
>> From: Simon Marchi <simon.marchi@polymtl.ca>
>> Date: Mon, 26 Oct 2015 13:26:51 -0400
>> Subject: [PATCH] guile: Simplify ioscm_make_gdb_stdio_port
>>
>> As pointed out by Pedro, it's clearer to do it this way. We can trust
>> that scm_mode_bits won't try to modify our string, even though it takes
>> a non-const char *.
>
> LGTM, though it's Doug's call.
Fine by me.