diff --git a/src/builtin.cmod b/src/builtin.cmod
index 624fbc4dc71d9653dd8d91fa103976f4767264af..542f012b6a548df94b0cd8cb8024b8a794415437 100644
--- a/src/builtin.cmod
+++ b/src/builtin.cmod
@@ -3095,7 +3095,7 @@ PIKECLASS Buffer
     struct Buffer_struct *str = THIS;
     struct pike_string *s = str->str.s;
     unsigned len = s->len, shift = s->size_shift;
-    void *p;
+    char *p;
 
     struct object *res;
     struct Buffer_struct *str2;
@@ -3418,7 +3418,7 @@ PIKECLASS Buffer
     struct object *res;
     struct pike_string *s = str->str.s;
     unsigned len = s->len,shift = s->size_shift;
-    void *p = s->str;
+    char *p = s->str;
     INT_TYPE end,vdiscard;
 
     end = args==1 ? len-1 : end_or_none->u.integer;
diff --git a/src/stralloc.c b/src/stralloc.c
index 0abd26f37298d671fc503ab68f83f73ff68d73c3..86ed83889c1cc16b0deb4355f3aaea00815435f7 100644
--- a/src/stralloc.c
+++ b/src/stralloc.c
@@ -1514,10 +1514,10 @@ ptrdiff_t generic_quick_binary_strcmp(const char *a,
                                       const char *b,
                                       ptrdiff_t blen, int bsize)
 {
+  ptrdiff_t pos;
   if(!asize && !bsize)
     return low_quick_binary_strcmp(a, alen, b, blen);
 
-  ptrdiff_t pos;
   for(pos=0;pos< MINIMUM(alen,blen) ;pos++)
   {
     p_wchar2 ac=generic_extract(a,asize,pos);