Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
e6f48d7e
Commit
e6f48d7e
authored
Oct 10, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
also compare "except" declaration when comparing C function signatures
parent
1e7d5729
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-0
tests/errors/pxd_signature_mismatch.pxd
tests/errors/pxd_signature_mismatch.pxd
+10
-0
tests/errors/pxd_signature_mismatch.pyx
tests/errors/pxd_signature_mismatch.pyx
+26
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
e6f48d7e
...
@@ -2404,6 +2404,10 @@ class CFuncType(CType):
...
@@ -2404,6 +2404,10 @@ class CFuncType(CType):
return
0
return
0
if
not
self
.
same_calling_convention_as
(
other_type
):
if
not
self
.
same_calling_convention_as
(
other_type
):
return
0
return
0
if
self
.
exception_value
!=
other_type
.
exception_value
:
return
0
if
self
.
exception_check
!=
other_type
.
exception_check
:
return
0
return
1
return
1
def
compatible_signature_with
(
self
,
other_type
,
as_cmethod
=
0
):
def
compatible_signature_with
(
self
,
other_type
,
as_cmethod
=
0
):
...
...
tests/errors/pxd_signature_mismatch.pxd
0 → 100644
View file @
e6f48d7e
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
tests/errors/pxd_signature_mismatch.pyx
0 → 100644
View file @
e6f48d7e
# 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
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment