Skip to content

Commit

Permalink
patch 8.2.4048: gcc complains about use of "%p" in printf
Browse files Browse the repository at this point in the history
Problem:    gcc complains about use of "%p" in printf.
Solution:   Add (void *) typecast. (Dominique Pellé, closes #9494)
  • Loading branch information
dpelle authored and brammool committed Jan 9, 2022
1 parent f85a424 commit c14f667
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/if_py_both.h
Expand Up @@ -3789,14 +3789,14 @@ TabPageAttr(TabPageObject *self, char *name)
TabPageRepr(TabPageObject *self)
{
if (self->tab == INVALID_TABPAGE_VALUE)
return PyString_FromFormat("<tabpage object (deleted) at %p>", (self));
return PyString_FromFormat("<tabpage object (deleted) at %p>", (void *)self);
else
{
int t = get_tab_number(self->tab);

if (t == 0)
return PyString_FromFormat("<tabpage object (unknown) at %p>",
(self));
(void *)self);
else
return PyString_FromFormat("<tabpage %d>", t - 1);
}
Expand Down Expand Up @@ -4125,14 +4125,14 @@ WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
WindowRepr(WindowObject *self)
{
if (self->win == INVALID_WINDOW_VALUE)
return PyString_FromFormat("<window object (deleted) at %p>", (self));
return PyString_FromFormat("<window object (deleted) at %p>", (void *)self);
else
{
int w = get_win_number(self->win, firstwin);

if (w == 0)
return PyString_FromFormat("<window object (unknown) at %p>",
(self));
(void *)self);
else
return PyString_FromFormat("<window %d>", w - 1);
}
Expand Down Expand Up @@ -5126,7 +5126,7 @@ RangeRepr(RangeObject *self)
{
if (self->buf->buf == INVALID_BUFFER_VALUE)
return PyString_FromFormat("<range object (for deleted buffer) at %p>",
(self));
(void *)self);
else
{
char *name = (char *)self->buf->buf->b_fname;
Expand Down Expand Up @@ -5378,7 +5378,7 @@ BufferRange(BufferObject *self, PyObject *args)
BufferRepr(BufferObject *self)
{
if (self->buf == INVALID_BUFFER_VALUE)
return PyString_FromFormat("<buffer object (deleted) at %p>", self);
return PyString_FromFormat("<buffer object (deleted) at %p>", (void *)self);
else
{
char *name = (char *)self->buf->b_fname;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4048,
/**/
4047,
/**/
Expand Down

0 comments on commit c14f667

Please sign in to comment.