Re: Py_XDECREF/Py_DECREF evaluating its argument more than once

2011-05-05 Thread Chris Rebert
On Thu, May 5, 2011 at 5:59 PM, Chris Angelico wrote: > Since inline functions are a part of C99 as well as C++, would it be > possible to have configure.sh detect its availability and optionally > use that instead of preprocessor macros, or would this run the risk of > encouraging trickily unpor

Re: Py_XDECREF/Py_DECREF evaluating its argument more than once

2011-05-05 Thread Chris Angelico
Clarification: This IS stated in the source - in object.h are the following sage words: --- *** WARNING*** The Py_DECREF macro must have a side-effect-free argument since it may evaluate its argument multiple times. (The alternative would be to mace it a proper function or assign it to a global t

Py_XDECREF/Py_DECREF evaluating its argument more than once

2011-05-05 Thread Chris Angelico
Okay, this is mainly a tale of a stupid C++ programmer who forgot the rules of C... I simplified a whole lot of code recently, cut out some temporary variables, did some general tidying-up, and then found that my program was segfaulting occasionally. Sure that I hadn't made any substantive changes