Commit b2ecfce3 authored by Robert Bradshaw's avatar Robert Bradshaw

Make bad pxd declarations into an warning for now.

This will be an error in the next version of Cython.
parent 45287740
...@@ -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")
......
...@@ -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
""" """
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