tnintemann / rpms / boost

Forked from rpms/boost 3 years ago
Clone

Blame SOURCES/boost-1.66.0-numpy3.patch

f4a353
From 0fce0e589353d772ceda4d493b147138406b22fd Mon Sep 17 00:00:00 2001
f4a353
From: =?UTF-8?q?Moritz=20Wanzenb=C3=B6ck?= <moritz.wanzenboeck@catalysts.cc>
f4a353
Date: Wed, 11 Jul 2018 11:57:46 +0200
f4a353
Subject: [PATCH] Add missing return statement in numpy import
f4a353
f4a353
This adds a missing return statement in the python3 specific
f4a353
import logic of boost.python.numpy.
f4a353
f4a353
For python3 wrap_import_array() needs to return a pointer value.
f4a353
The import_array() macro only returns NULL in case of error. The
f4a353
missing return statement is UB, so the compiler can assume it does
f4a353
not happen. This means the compiler can assume the error branch
f4a353
is always taken, so import_array must always fail.
f4a353
---
f4a353
 src/numpy/numpy.cpp | 1 +
f4a353
 1 file changed, 1 insertion(+)
f4a353
f4a353
diff --git a/src/numpy/numpy.cpp b/src/numpy/numpy.cpp
f4a353
index 8e259bc75..3ae2295e3 100644
f4a353
--- a/libs/python/src/numpy/numpy.cpp
f4a353
+++ b/libs/python/src/numpy/numpy.cpp
f4a353
@@ -19,6 +19,7 @@ static void wrap_import_array()
f4a353
 static void * wrap_import_array()
f4a353
 {
f4a353
   import_array();
f4a353
+  return NULL;
f4a353
 }
f4a353
 #endif
f4a353