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):
elif type.compatible_signature_with(entry.type, as_cmethod = 1) and type.nogil == entry.type.nogil:
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)):
error(pos,
# TODO(robertwb): Make this an error.
warning(pos,
"Compatible but non-identical C method '%s' not redeclared "
"in definition part of extension type '%s'" % (name, self.class_name))
error(entry.pos, "Previous declaration is here")
"in definition part of extension type '%s'. This may cause incorrect vtables to be generated." % (name, self.class_name), 2)
warning(entry.pos, "Previous declaration is here", 2)
entry = self.add_cfunction(name, type, pos, cname, visibility='ignore', modifiers=modifiers)
else:
error(pos, "Signature not compatible with previous declaration")
......
......@@ -37,8 +37,9 @@ cdef class NarrowerReturn(Base):
_ERRORS = u"""
8: 9: Signature not compatible with previous declaration
4: 9: Previous declaration is here
18:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'MissingRedeclaration'
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
# TODO(robertwb): Re-enable these errors.
#18:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'MissingRedeclaration'
#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