From: Robert Bradshaw Date: Sat, 29 Jan 2011 09:25:51 +0000 (-0800) Subject: Allow extern "functions" (e.g. macros) to return array types. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7cdfd770c17aff45aa212cb69eb181da853ac814;p=cython.git Allow extern "functions" (e.g. macros) to return array types. --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 35d2b88a..9251e018 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -607,9 +607,6 @@ class CFuncDeclaratorNode(CDeclaratorNode): error(self.exception_value.pos, "Exception value incompatible with function return type") exc_check = self.exception_check - if return_type.is_array: - error(self.pos, - "Function cannot return an array") if return_type.is_cfunction: error(self.pos, "Function cannot return a function") @@ -1656,6 +1653,9 @@ class CFuncDefNode(FuncDefNode): api = self.api, modifiers = self.modifiers) self.entry.inline_func_in_pxd = self.inline_in_pxd self.return_type = type.return_type + if self.return_type.is_array and visibility != 'extern': + error(self.pos, + "Function cannot return an array") if self.overridable and not env.is_module_scope: if len(self.args) < 1 or not self.args[0].type.is_pyobject: