summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-04-21 09:34:58 +0200
committerStefan Behnel <stefan_ml@behnel.de>2020-04-21 09:34:58 +0200
commit12bbe5f3d209d5c8e2d5a6a89f94d97fbb33d78f (patch)
tree0d5e7c54243841ee1bed2eabdd88bd8438ac9517
parent0917df8f32515daa0c67d0caf2104462aebd36ae (diff)
downloadcython-12bbe5f3d209d5c8e2d5a6a89f94d97fbb33d78f.tar.gz
Try if we can avoid a C compiler warning in clang for a constant strchr() call.
-rw-r--r--Cython/Utility/ImportExport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Cython/Utility/ImportExport.c b/Cython/Utility/ImportExport.c
index a21038748..68e37ce76 100644
--- a/Cython/Utility/ImportExport.c
+++ b/Cython/Utility/ImportExport.c
@@ -180,7 +180,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
{
#if PY_MAJOR_VERSION >= 3
if (level == -1) {
- if ((strchr(__Pyx_MODULE_NAME, '.'))) {
+ // Avoid C compiler warning if strchr() evaluates to false at compile time.
+ if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
/* try package relative import first */
#if CYTHON_COMPILING_IN_LIMITED_API
module = PyImport_ImportModuleLevelObject(