Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: sivachandra@google.com (Siva Chandra)
Cc: gdb-patches@sourceware.org (gdb-patches)
Subject: Re: [PATCH 4/4 v20] Add xmethod support to the Python API
Date: Wed, 04 Jun 2014 14:39:00 -0000	[thread overview]
Message-ID: <201406041439.s54Ed5O9003601@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <CAGyQ6gy9LcaAJ-LSqrnwz+6HZDQ-ZX9wvRgWgu+rKFBTaNMmXA@mail.gmail.com> from "Siva Chandra" at Jun 02, 2014 11:58:44 AM

Siva Chandra wrote:

> 2014-06-02  Siva Chandra Reddy  <sivachandra@google.com>
> 
>         * python/py-xmethods.c: New file.

This fails to build with -Werror against Python 2.4:

cc1: warnings being treated as errors
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c: In function 'invoke_match_method':
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c:109: warning: passing argument 2 of 'PyObject_GetAttrString' discards qualifiers from pointer target type
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c:130: warning: passing argument 2 of 'PyObject_GetAttrString' discards qualifiers from pointer target type
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c: In function 'gdbpy_get_matching_xmethod_workers':
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c:255: warning: passing argument 2 of 'PyObject_HasAttrString' discards qualifiers from pointer target type
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c:261: warning: passing argument 2 of 'PyObject_GetAttrString' discards qualifiers from pointer target type
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c: In function 'gdbpy_get_xmethod_arg_types':
/home/uweigand/dailybuild/spu-tc-2014-06-03/binutils-gdb-head/binutils-gdb/gdb/python/py-xmethods.c:395: warning: passing argument 2 of 'PyObject_GetAttrString' discards qualifiers from pointer target type

The problem is that in Python 2.4, the second argument to
PyObject_GetAttrString was missing the "const" qualifier.

In other places, we've been working around this by adding
(char *) casts as necessary.

However, with the new code I'm wondering:

static const char enabled_field_name[] = "enabled";
[...]
  enabled_field = PyObject_GetAttrString (matcher, enabled_field_name);

What's the reason for using that variable instead of just
  enabled_field = PyObject_GetAttrString (matcher, "enabled");
(as is done elsewhere in the GDB Python code)?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


      parent reply	other threads:[~2014-06-04 14:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 18:58 Siva Chandra
2014-06-03  2:02 ` Doug Evans
2014-06-03 17:12   ` Siva Chandra
2014-06-04  0:28     ` Doug Evans
2014-06-04 13:13 ` Pedro Alves
2014-06-04 13:29   ` Siva Chandra
2014-06-04 14:39 ` Ulrich Weigand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201406041439.s54Ed5O9003601@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sivachandra@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox