Message298973
C programs using PyMem_MALLOC in pymem.h generate a warning when -Wint-in-bool-context is enabled (typically through -Wall). In places where -Werror is enabled (such as RPM build), this causes the build to fail with an error that looks like:
...
In file included from /usr/include/python2.7/Python.h:78:0,
from netnsmodule.c:16:
netnsmodule.c: In function 'netns_nsexecvp':
/usr/include/python2.7/pymem.h:97:30: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )
^
/usr/include/python2.7/pymem.h:75:15: note: in definition of macro 'PyMem_MALLOC'
: malloc((n) ? (n) : 1))
^
netnsmodule.c:61:10: note: in expansion of macro 'PyMem_NEW'
argv = PyMem_NEW(char *, argc + 1);
^~~~~~~~~
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
...
I'm attaching a patch that fixes the issue, please consider applying!
Thanks,
--Gabriel |
|
Date |
User |
Action |
Args |
2017-07-24 14:15:36 | Gabriel Somlo | set | recipients:
+ Gabriel Somlo |
2017-07-24 14:15:36 | Gabriel Somlo | set | messageid: <1500905736.49.0.103266302575.issue31013@psf.upfronthosting.co.za> |
2017-07-24 14:15:36 | Gabriel Somlo | link | issue31013 messages |
2017-07-24 14:15:36 | Gabriel Somlo | create | |
|