diff --git generic/tclUtil.c generic/tclUtil.c
index 8d2347b5c..8e9b4c0e4 100644
--- generic/tclUtil.c
+++ generic/tclUtil.c
@@ -1593,7 +1593,7 @@ Tcl_Merge(
     }
     for (i = 0; i < argc; i++) {
 	flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
-	bytesNeeded += TclScanElement(argv[i], -1, &flagPtr[i]);
+	bytesNeeded += (unsigned int)TclScanElement(argv[i], -1, &flagPtr[i]);
 	if (bytesNeeded < 0) {
 	    Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
 	}
