Commit e6f48d7e authored by Stefan Behnel's avatar Stefan Behnel

also compare "except" declaration when comparing C function signatures

parent 1e7d5729
......@@ -2404,6 +2404,10 @@ class CFuncType(CType):
return 0
if not self.same_calling_convention_as(other_type):
return 0
if self.exception_value != other_type.exception_value:
return 0
if self.exception_check != other_type.exception_check:
return 0
return 1
def compatible_signature_with(self, other_type, as_cmethod = 0):
......
cdef int wrong_args(int x, long y)
cdef long wrong_return_type(int x, int y)
cdef int wrong_exception_check(int x, int y) except 0
cdef int wrong_exception_value(int x, int y) except 0
cdef int wrong_exception_value_check(int x, int y) except 0
# mode: error
# tag: pxd
cdef int wrong_args(int x, int y):
return 0
cdef int wrong_return_type(int x, int y):
return 0
cdef int wrong_exception_check(int x, int y) except? 0:
return 0
cdef int wrong_exception_value(int x, int y) except 1:
return 0
cdef int wrong_exception_value_check(int x, int y) except? 1:
return 0
_ERRORS = """
4:5: Function signature does not match previous declaration
7:5: Function signature does not match previous declaration
10:5: Function signature does not match previous declaration
13:5: Function signature does not match previous declaration
16:5: Function signature does not match previous declaration
"""
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