Commit 19caad02 authored by Robert Bradshaw's avatar Robert Bradshaw

Suppress (verbose) may-be-used-uninitialized errors.

parent 341650c4
...@@ -702,6 +702,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -702,6 +702,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
PyrexTypes.c_int_type.create_from_py_utility_code(env) PyrexTypes.c_int_type.create_from_py_utility_code(env)
code.put(Nodes.branch_prediction_macros) code.put(Nodes.branch_prediction_macros)
code.putln('static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) {}')
code.putln('') code.putln('')
code.putln('static PyObject *%s;' % env.module_cname) code.putln('static PyObject *%s;' % env.module_cname)
code.putln('static PyObject *%s;' % env.module_dict_cname) code.putln('static PyObject *%s;' % env.module_dict_cname)
......
...@@ -1938,6 +1938,8 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -1938,6 +1938,8 @@ class FuncDefNode(StatNode, BlockNode):
val = self.return_type.default_value val = self.return_type.default_value
if val: if val:
code.putln("%s = %s;" % (Naming.retval_cname, val)) code.putln("%s = %s;" % (Naming.retval_cname, val))
elif not self.return_type.is_void:
code.putln("__Pyx_pretend_to_initialize(&%s);" % Naming.retval_cname)
# ----- Error cleanup # ----- Error cleanup
if code.error_label in code.labels_used: if code.error_label in code.labels_used:
if not self.body.is_terminator: if not self.body.is_terminator:
...@@ -1992,6 +1994,8 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -1992,6 +1994,8 @@ class FuncDefNode(StatNode, BlockNode):
err_val = default_retval err_val = default_retval
if err_val is not None: if err_val is not None:
code.putln("%s = %s;" % (Naming.retval_cname, err_val)) code.putln("%s = %s;" % (Naming.retval_cname, err_val))
elif not self.return_type.is_void:
code.putln("__Pyx_pretend_to_initialize(&%s);" % Naming.retval_cname)
if is_getbuffer_slot: if is_getbuffer_slot:
self.getbuffer_error_cleanup(code) self.getbuffer_error_cleanup(code)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment