Bugs item #1113244, was opened at 2005-01-31 16:01 Message generated for change (Comment added) made by rjk1002 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: Tim Peters (tim_one) 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. ---------------------------------------------------------------------- >Comment By: Richard Kettlewell (rjk1002) Date: 2005-02-01 09:51 Message: Logged In: YES user_id=217390 Making it compiler-specific seems silly. It's not like the do-while idiom for macros is some strange gcc-specific thing; most people just use it unconditionally on complicated macros. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2005-02-01 02:53 Message: Logged In: YES user_id=80475 Tim, what you think about doing this with a conditional compile to only redefine for GCC? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1113244&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com