diff --git a/Misc/NEWS b/Misc/NEWS index f7a18c0b2c5..0a328bde66c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -15,6 +15,9 @@ Core and Builtins - Issue #3642: Changed type of numarenas from uint to size_t in order to silence a compilier warning on 64bit OSes. +- Silenced another compiler warning about a used but not defined + function 'stringlib_contains_obj'. + Library ------- diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 5ba1f6d8e52..c4fc37f070e 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1098,6 +1098,7 @@ bytes_dealloc(PyByteArrayObject *self) #define STRINGLIB_EMPTY nullbytes #define STRINGLIB_CHECK_EXACT PyByteArray_CheckExact #define STRINGLIB_MUTABLE 1 +#define FROM_BYTEARRAY 1 #include "stringlib/fastsearch.h" #include "stringlib/count.h" diff --git a/Objects/stringlib/find.h b/Objects/stringlib/find.h index 5b17c7fb079..9e0d2998452 100644 --- a/Objects/stringlib/find.h +++ b/Objects/stringlib/find.h @@ -90,7 +90,7 @@ stringlib_rfind_slice(const STRINGLIB_CHAR* str, Py_ssize_t str_len, return stringlib_rfind(str + start, end - start, sub, sub_len, start); } -#ifdef STRINGLIB_STR +#if defined(STRINGLIB_STR) && !defined(FROM_BYTEARRAY) Py_LOCAL_INLINE(int) stringlib_contains_obj(PyObject* str, PyObject* sub)