Commit 5515459e authored by Vitja Makarov's avatar Vitja Makarov

Silence CF warnings when taking address of C variable, fix ticket #714

--HG--
extra : transplant_source : L%3A%00/%B9%85%14%5CE/%C3%3A%A0%A4z%1C%2C%08%F2%C9
parent 025ae157
......@@ -1109,3 +1109,10 @@ class CreateControlFlowGraph(CythonTransform):
self.flow.nextblock()
self.env = self.env_stack.pop()
return node
def visit_AmpersandNode(self, node):
if node.operand.is_name:
# Fake assignment to silence warning
self.mark_assignment(node.operand)
self.visitchildren(node)
return node
# mode: run
# tag: werror
# ticket: 714
def test_ptr():
"""
>>> test_ptr()
123
"""
cdef int a
cdef int *ptr
ptr = &a
ptr[0] = 123
return a
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