From: Stefan Behnel Date: Tue, 31 Dec 2013 10:19:00 +0000 (+0100) Subject: fix C compiler warnings about unused utility code X-Git-Tag: 0.20b1~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d730a00d4c82c7402d27700965482b9eba426103;p=platform%2Fupstream%2Fpython-cython.git fix C compiler warnings about unused utility code --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index f76f872..810542d 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -6577,11 +6577,13 @@ class TryFinallyStatNode(StatNode): if self.is_try_finally_in_nogil: code.put_ensure_gil(declare_gilstate=False) - code.putln("#if PY_MAJOR_VERSION >= 3") + # not using preprocessor here to avoid warnings about + # unused utility functions and/or temps + code.putln("if (PY_MAJOR_VERSION >= 3) {") for var in exc_vars[3:]: code.put_xgiveref(var) code.putln("__Pyx_ExceptionReset(%s, %s, %s);" % exc_vars[3:]) - code.putln("#endif") + code.putln("}") for var in exc_vars[:3]: code.put_xgiveref(var) code.putln("__Pyx_ErrRestore(%s, %s, %s);" % exc_vars[:3]) @@ -6600,11 +6602,13 @@ class TryFinallyStatNode(StatNode): code.globalstate.use_utility_code(reset_exception_utility_code) if self.is_try_finally_in_nogil: code.put_ensure_gil(declare_gilstate=False) - code.putln("#if PY_MAJOR_VERSION >= 3") + # not using preprocessor here to avoid warnings about + # unused utility functions and/or temps + code.putln("if (PY_MAJOR_VERSION >= 3) {") for var in exc_vars[3:]: code.put_xgiveref(var) code.putln("__Pyx_ExceptionReset(%s, %s, %s);" % exc_vars[3:]) - code.putln("#endif") + code.putln("}") for var in exc_vars[:3]: code.put_xdecref_clear(var, py_object_type) if self.is_try_finally_in_nogil: