Commit 2439267d authored by Vitja Makarov's avatar Vitja Makarov

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

parent d95362ee
...@@ -1106,3 +1106,10 @@ class CreateControlFlowGraph(CythonTransform): ...@@ -1106,3 +1106,10 @@ class CreateControlFlowGraph(CythonTransform):
self.flow.nextblock() self.flow.nextblock()
self.env = self.env_stack.pop() self.env = self.env_stack.pop()
return node 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