Python object pointer cast warnings
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 2 Feb 2008 09:10:01 +0000 (01:10 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 2 Feb 2008 09:10:01 +0000 (01:10 -0800)
Cython/Compiler/ExprNodes.py

index 7c548864a1f0069346ca5ffd30bca539b2d8a923..09f088c766a461b20e68184ebdd8941e0f5ad01d 100644 (file)
@@ -2610,9 +2610,13 @@ class TypecastNode(ExprNode):
             self.is_temp = 1
             if self.operand.type.to_py_function:
                 self.operand = self.operand.coerce_to_pyobject(env)
+            else:
+                warning(self.pos, "No conversion from %s to %s, python object pointer used." % (self.operand.type, self.type))
         elif from_py and not to_py:
             if self.type.from_py_function:
                 self.operand = self.operand.coerce_to(self.type, env)
+            else:
+                warning(self.pos, "No conversion from %s to %s, python object pointer used." % (self.type, self.operand.type))
     
     def check_const(self):
         self.operand.check_const()