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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
b2ecfce3
Commit
b2ecfce3
authored
Jul 03, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make bad pxd declarations into an warning for now.
This will be an error in the next version of Cython.
parent
45287740
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+4
-3
tests/errors/cmethbasematch.pyx
tests/errors/cmethbasematch.pyx
+5
-4
No files found.
Cython/Compiler/Symtab.py
View file @
b2ecfce3
...
@@ -2100,10 +2100,11 @@ class CClassScope(ClassScope):
...
@@ -2100,10 +2100,11 @@ class CClassScope(ClassScope):
elif
type
.
compatible_signature_with
(
entry
.
type
,
as_cmethod
=
1
)
and
type
.
nogil
==
entry
.
type
.
nogil
:
elif
type
.
compatible_signature_with
(
entry
.
type
,
as_cmethod
=
1
)
and
type
.
nogil
==
entry
.
type
.
nogil
:
if
(
self
.
defined
and
not
in_pxd
if
(
self
.
defined
and
not
in_pxd
and
not
type
.
same_c_signature_as_resolved_type
(
entry
.
type
,
as_cmethod
=
1
,
as_pxd_definition
=
1
)):
and
not
type
.
same_c_signature_as_resolved_type
(
entry
.
type
,
as_cmethod
=
1
,
as_pxd_definition
=
1
)):
error
(
pos
,
# TODO(robertwb): Make this an error.
warning
(
pos
,
"Compatible but non-identical C method '%s' not redeclared "
"Compatible but non-identical C method '%s' not redeclared "
"in definition part of extension type '%s'
"
%
(
name
,
self
.
class_name
)
)
"in definition part of extension type '%s'
. This may cause incorrect vtables to be generated."
%
(
name
,
self
.
class_name
),
2
)
error
(
entry
.
pos
,
"Previous declaration is here"
)
warning
(
entry
.
pos
,
"Previous declaration is here"
,
2
)
entry
=
self
.
add_cfunction
(
name
,
type
,
pos
,
cname
,
visibility
=
'ignore'
,
modifiers
=
modifiers
)
entry
=
self
.
add_cfunction
(
name
,
type
,
pos
,
cname
,
visibility
=
'ignore'
,
modifiers
=
modifiers
)
else
:
else
:
error
(
pos
,
"Signature not compatible with previous declaration"
)
error
(
pos
,
"Signature not compatible with previous declaration"
)
...
...
tests/errors/cmethbasematch.pyx
View file @
b2ecfce3
...
@@ -37,8 +37,9 @@ cdef class NarrowerReturn(Base):
...
@@ -37,8 +37,9 @@ cdef class NarrowerReturn(Base):
_ERRORS
=
u"""
_ERRORS
=
u"""
8: 9: Signature not compatible with previous declaration
8: 9: Signature not compatible with previous declaration
4: 9: Previous declaration is here
4: 9: Previous declaration is here
18:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'MissingRedeclaration'
# TODO(robertwb): Re-enable these errors.
2:9: Previous declaration is here
#18:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'MissingRedeclaration'
23:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'BadRedeclaration'
#2:9: Previous declaration is here
2:9: Previous declaration is here
#23:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'BadRedeclaration'
#2:9: Previous declaration is here
"""
"""
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