This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix py-xmethods.c when compiled with -Werror against Python 2.4
- From: Siva Chandra <sivachandra at google dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, Doug Evans <dje at google dot com>, uweigand at de dot ibm dot com
- Date: Wed, 4 Jun 2014 11:25:20 -0700
- Subject: Re: [PATCH] Fix py-xmethods.c when compiled with -Werror against Python 2.4
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gydnP62Od_5iUv1PeCquRSVNNJky31C8ZwTDY3ret8ACQ at mail dot gmail dot com> <20140604181342 dot GW4289 at adacore dot com>
On Wed, Jun 4, 2014 at 11:13 AM, Joel Brobecker <brobecker@adacore.com> wrote:
>> Does the attached patch fix the issue pointed out by Ulrich Weigand
>> here: https://sourceware.org/ml/gdb-patches/2014-06/msg00169.html
>>
>> ChangeLog
>> 2014-06-04 Siva Chandra Reddy <sivachandra@google.com>
>>
>> * python/py-xmethods.c (invoke_match_method)
>> (gdbpy_get_matching_xmethod_workers, gdbpy_get_xmethod_arg_types):
>> Cast the second arg to PyObject_GetAttrString and
>> PyObject_GetAttrString to char *.
>
> I can't tell whether it fixes the problem - it should! - but looking
> at the patch, I think some lines might have become longer than 80
> characters...
I double checked again. Two of the lines are at 80. Rest of the lines
touched are less than 80.
> Also, it'd be nice to answer Ulrich's question regarding the use
> of the constants - whether it might make sense to use the string
> directly? Looking at the code, I think that it would be to avoid
> duplicating that string? enabled_field_name is only used once,
> but then you'd probably use the constant for ... consistency (;-)).
Yes. That is the reason. Sorry for not mentioning it earlier.