Warning for implicitly declared variables.
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 22 Jan 2010 00:23:13 +0000 (16:23 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 22 Jan 2010 00:23:13 +0000 (16:23 -0800)
Cython/Compiler/ExprNodes.py

index 6679002a51e441baaab9cb0f153665c3b5297d28..625d16af092a353266bef128c10f7fdf2e39174e 100644 (file)
@@ -1157,6 +1157,8 @@ class NameNode(AtomicExprNode):
         if not self.entry:
             self.entry = env.lookup_here(self.name)
         if not self.entry:
+            if env.directives['warn.undeclared']:
+                warning(self.pos, "implicit declaration of '%s'" % self.name, 1)
             if env.directives['infer_types'] != False:
                 type = unspecified_type
             else: