Better error for foo(void)
authorRobert Bradshaw <robertwb@math.washington.edu>
Mon, 28 Apr 2008 18:21:33 +0000 (11:21 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Mon, 28 Apr 2008 18:21:33 +0000 (11:21 -0700)
Cython/Compiler/Nodes.py

index 544b9cd9394a44d128db654350aaed8106a9eacb..54c58b0f65b2a9607d2473f4ab78531f1a029eda 100644 (file)
@@ -480,7 +480,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
                 type = PyrexTypes.c_ptr_type(type.base_type)
             # Catch attempted C-style func(void) decl
             if type.is_void:
-                error(arg_node.pos, "Function argument cannot be void")
+                error(arg_node.pos, "Use spam() rather than spam(void) to declare a function with no arguments.")
             if type.is_pyobject and self.nogil:
                 error(self.pos,
                     "Function with Python argument cannot be declared nogil")