Error message (rather than traceback) on missing name in cdef declarator
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 10 Oct 2007 10:19:20 +0000 (03:19 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 10 Oct 2007 10:19:20 +0000 (03:19 -0700)
Cython/Compiler/Nodes.py

index 80cffc311d78ef6d01cbbad58616a6cd2859cb53..8976cd7a62d53174cefe4386e31c819b88081794 100644 (file)
@@ -429,6 +429,9 @@ class CVarDefNode(StatNode):
                     "Python object cannot be declared extern")
             name = name_declarator.name
             cname = name_declarator.cname
+            if name == '':
+                error(declarator.pos, "Missing name in declaration.")
+                return
             if type.is_cfunction:
                 dest_scope.declare_cfunction(name, type, declarator.pos,
                     cname = cname, visibility = self.visibility)