]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-90949: Fix an "unused function" compiler warning introduced in GH-139234 (#139558)
authorSebastian Pipping <sebastian@pipping.org>
Sat, 4 Oct 2025 14:19:06 +0000 (16:19 +0200)
committerGitHub <noreply@github.com>
Sat, 4 Oct 2025 14:19:06 +0000 (14:19 +0000)
Fix a compiler warning `-Wunused-function` after f04bea44c37793561d753dd4ca6e7cd658137553.

The `set_invalid_arg` function in `Modules/pyexpat.c` may be unused if the underlying Expat
version is less than 2.4.0.

Modules/pyexpat.c

index 7f6d84ad8641ca0e17884e2e044823ac1599387c..9949e185dce9c7da5422f5679618f31f2197b7f4 100644 (file)
@@ -198,12 +198,14 @@ set_error(pyexpat_state *state, xmlparseobject *self, enum XML_Error code)
     return NULL;
 }
 
+#if XML_COMBINED_VERSION >= 20400
 static PyObject *
 set_invalid_arg(pyexpat_state *state, xmlparseobject *self, const char *errmsg)
 {
     SET_XML_ERROR(state, self, XML_ERROR_INVALID_ARGUMENT, errmsg);
     return NULL;
 }
+#endif
 
 #undef SET_XML_ERROR