Commit bc3427ca authored by Robert Bradshaw's avatar Robert Bradshaw

Error message (rather than traceback) on missing name in cdef declarator

parent bb8d6907
...@@ -429,6 +429,9 @@ class CVarDefNode(StatNode): ...@@ -429,6 +429,9 @@ class CVarDefNode(StatNode):
"Python object cannot be declared extern") "Python object cannot be declared extern")
name = name_declarator.name name = name_declarator.name
cname = name_declarator.cname cname = name_declarator.cname
if name == '':
error(declarator.pos, "Missing name in declaration.")
return
if type.is_cfunction: if type.is_cfunction:
dest_scope.declare_cfunction(name, type, declarator.pos, dest_scope.declare_cfunction(name, type, declarator.pos,
cname = cname, visibility = self.visibility) cname = cname, visibility = self.visibility)
......
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