[ python-Bugs-1113244 ] Please add do-while guard to Py_DECREF etc.

SourceForge.net noreply at sourceforge.net
Mon Jan 31 17:01:13 CET 2005


Bugs item #1113244, was opened at 2005-01-31 16:01
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1113244&group_id=5470

Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Kettlewell (rjk1002)
Assigned to: Nobody/Anonymous (nobody)
Summary: Please add do-while guard to Py_DECREF etc.

Initial Comment:
Py_DECREF() is missing do-while macro guards (as found
e.g. in Py_CLEAR), instead relying on being an if-else
to avoid the usual problems associated with such macros.

However if it is used as e.g. "if (newref)
Py_DECREF(obj);" then gcc -Wall still complains about
an ambiguous else clause.  (gcc version is 3.3.5)

Granted it is only a warning but like many people we
build with -Werror, and the code in question is in SWIG
output rather than our own code, so this is quite
painful for us.

At least Py_DECREF, Py_XDECREF and Py_XINCREF need
fixing; I've not checked beyond this.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1113244&group_id=5470


More information about the Python-bugs-list mailing list