diff --git a/src/port.h b/src/port.h
index 82540248ee1aeda914b15ec02b140ed5f0a59212..2333dfa9269b4dd7d8bfc4758ce8688f8c2a5cad 100644
--- a/src/port.h
+++ b/src/port.h
@@ -180,7 +180,7 @@ PMOD_EXPORT int STRCASECMP(const char *a,const char *b);
 #define MEMMOVE memmove
 
 #define HAVE_MEMCMP 1
-#define MEMCMP(X,Y,Z) memcmp((char*)(X),(char*)(Y),(Z))
+#define MEMCMP(X,Y,Z) memcmp((X),(Y),(Z))
 
 #ifndef HAVE_MEMCHR
 PMOD_EXPORT void *MEMCHR(const void *p,char c,size_t e);
diff --git a/src/stralloc.h b/src/stralloc.h
index d3c687fa252b300cb2e59504d5937f73b730a128..2ddc9d7943de1f0a2a457d43d8649b3242793ace 100644
--- a/src/stralloc.h
+++ b/src/stralloc.h
@@ -263,9 +263,9 @@ PMOD_EXPORT extern struct shared_string_location *all_shared_string_locations;
 #define convert_1_to_1(X,Y,Z) memcpy((X),(Y),(Z)<<1)
 #define convert_2_to_2(X,Y,Z) memcpy((X),(Y),(Z)<<2)
 
-#define compare_0_to_0(X,Y,Z) memcmp((char *)(X),(char *)(Y),(Z))
-#define compare_1_to_1(X,Y,Z) memcmp((char *)(X),(char *)(Y),(Z)<<1)
-#define compare_2_to_2(X,Y,Z) memcmp((char *)(X),(char *)(Y),(Z)<<2)
+#define compare_0_to_0(X,Y,Z) memcmp((X),(Y),(Z))
+#define compare_1_to_1(X,Y,Z) memcmp((X),(Y),(Z)<<1)
+#define compare_2_to_2(X,Y,Z) memcmp((X),(Y),(Z)<<2)
 
 #define CONVERT(FROM,TO) \
 void PIKE_CONCAT4(convert_,FROM,_to_,TO)(PIKE_CONCAT(p_wchar,TO) *to, const PIKE_CONCAT(p_wchar,FROM) *from, ptrdiff_t len); \