diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2019-02-23 16:31:38 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2019-02-23 16:31:38 +0100 |
commit | 2a86c67bf8af6a60ce14f5c75216cfcddacf1115 (patch) | |
tree | 70e080a8797baa94931c3a52c7c9d1686797a02b | |
parent | c97860d33ad3b894499a66eefb7e49d2cb11435e (diff) | |
download | cython-2a86c67bf8af6a60ce14f5c75216cfcddacf1115.tar.gz |
Disable the new compiler warning about ambiguous exception return values when the function is external (and therefore possibly not under the control of the user).
-rw-r--r-- | Cython/Compiler/Nodes.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index e16cc8a1a..42ef109b3 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -758,7 +758,9 @@ class CFuncDeclaratorNode(CDeclaratorNode): if not return_type.assignable_from(self.exception_value.type): error(self.exception_value.pos, "Exception value incompatible with function return type") - if (return_type.is_int or return_type.is_float) and self.exception_value.has_constant_result(): + if (visibility != 'extern' + and (return_type.is_int or return_type.is_float) + and self.exception_value.has_constant_result()): try: type_default_value = float(return_type.default_value) except ValueError: |