diff --git generic/tclCmdMZ.c generic/tclCmdMZ.c
index d769da821e..b94a82d894 100644
--- generic/tclCmdMZ.c
+++ generic/tclCmdMZ.c
@@ -2696,6 +2696,48 @@ StringCmpCmd(
  *----------------------------------------------------------------------
  */
 
+/* Use memCmpFn_t-compatible wrapper functions to avoid bug abd489a1cf47. */
+static int
+WrapUniCharNcasecmp(
+    const void *s1,
+    const void *s2,
+    size_t n)
+{
+    return Tcl_UniCharNcasecmp(s1, s2, n);
+}
+static int
+WrapUtfNcasecmp(
+    const void *s1,
+    const void *s2,
+    size_t n)
+{
+    return Tcl_UtfNcasecmp(s1, s2, n);
+}
+static int
+WrapUtfNcmp(
+    const void *s1,
+    const void *s2,
+    size_t n)
+{
+    return Tcl_UtfNcmp(s1, s2, n);
+}
+static int
+WrapUniCharNcmp(
+    const void *s1,
+    const void *s2,
+    size_t n)
+{
+    return Tcl_UniCharNcmp(s1, s2, n);
+}
+static int
+WrapUtfNcmp2(
+    const void *s1,
+    const void *s2,
+    size_t n)
+{
+    return TclpUtfNcmp2(s1, s2, n);
+}
+
 int
 TclStringCmp(
     Tcl_Obj *value1Ptr,
@@ -2740,7 +2782,7 @@ TclStringCmp(
 	if (nocase) {
 	    s1 = (char *) Tcl_GetUnicodeFromObj(value1Ptr, &s1len);
 	    s2 = (char *) Tcl_GetUnicodeFromObj(value2Ptr, &s2len);
-	    memCmpFn = (memCmpFn_t)Tcl_UniCharNcasecmp;
+	    memCmpFn = WrapUniCharNcasecmp;
 	} else {
 	    s1len = Tcl_GetCharLength(value1Ptr);
 	    s2len = Tcl_GetCharLength(value2Ptr);
@@ -2771,7 +2813,7 @@ TclStringCmp(
 			reqlength *= sizeof(Tcl_UniChar);
 		    }
 		} else {
-		    memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
+		    memCmpFn = WrapUniCharNcmp;
 		}
 	    }
 	}
@@ -2827,12 +2869,11 @@ TclStringCmp(
 	     */
 
 	    if ((reqlength < 0) && !nocase) {
-		memCmpFn = (memCmpFn_t) TclpUtfNcmp2;
+		memCmpFn = WrapUtfNcmp2;
 	    } else {
 		s1len = Tcl_NumUtfChars(s1, s1len);
 		s2len = Tcl_NumUtfChars(s2, s2len);
-		memCmpFn = (memCmpFn_t)
-		    (nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
+		memCmpFn = nocase ? WrapUtfNcasecmp : WrapUtfNcmp;
 	    }
 	}
     }
