This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Gabriel Somlo
Recipients Gabriel Somlo
Date 2017-07-24.14:15:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500905736.49.0.103266302575.issue31013@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2017-07-24 14:15:36Gabriel Somlosetrecipients: + Gabriel Somlo
2017-07-24 14:15:36Gabriel Somlosetmessageid: <1500905736.49.0.103266302575.issue31013@psf.upfronthosting.co.za>
2017-07-24 14:15:36Gabriel Somlolinkissue31013 messages
2017-07-24 14:15:36Gabriel Somlocreate