Commit 7dbd42a4 authored by Volker Mische's avatar Volker Mische

Add casting to const

The included test is derived from a real world case
which would lead to warnings in GCC if the pointer
wouldn't be explicitly casted to const.
parent 37ceab84
...@@ -1125,9 +1125,11 @@ class FusedTypeNode(CBaseTypeNode): ...@@ -1125,9 +1125,11 @@ class FusedTypeNode(CBaseTypeNode):
class CConstTypeNode(CBaseTypeNode): class CConstTypeNode(CBaseTypeNode):
# name string
# base_type CBaseTypeNode # base_type CBaseTypeNode
child_attrs = ["base_type"] child_attrs = ["base_type"]
name = 'const'
def analyse(self, env, could_be_name = False): def analyse(self, env, could_be_name = False):
base = self.base_type.analyse(env, could_be_name) base = self.base_type.analyse(env, could_be_name)
......
# mode: compile
from libc.stdlib cimport malloc, free
cdef void f():
cdef const int **allocated = <const int **>malloc(sizeof(int *))
free(allocated)
f()
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