diff --git a/src/stralloc.c b/src/stralloc.c
index e9aca391aee6bc384c5229196e52c696c4651b89..6679a8c7159a618cf124eb7a6f78ea8f3d4913af 100644
--- a/src/stralloc.c
+++ b/src/stralloc.c
@@ -253,7 +253,7 @@ void low_set_index(struct pike_string *s, ptrdiff_t pos, int value)
 }
 
 #ifdef PIKE_DEBUG
-PMOD_EXPORT struct pike_string *debug_check_size_shift(struct pike_string *a,
+PMOD_EXPORT struct pike_string *debug_check_size_shift(const struct pike_string *a,
 						       int shift)
 {
   if(a->size_shift != shift)
diff --git a/src/stralloc.h b/src/stralloc.h
index 56681599beebb634b258f33a0f1c26774815de13..fa2e000ed17a08e7462dee33253530b2b53fb164 100644
--- a/src/stralloc.h
+++ b/src/stralloc.h
@@ -288,7 +288,7 @@ PMOD_EXPORT extern struct pike_string *empty_pike_string;
 
 /* Prototypes begin here */
 void low_set_index(struct pike_string *s, ptrdiff_t pos, int value);
-PMOD_EXPORT struct pike_string *debug_check_size_shift(struct pike_string *a,int shift);
+PMOD_EXPORT struct pike_string *debug_check_size_shift(const struct pike_string *a,int shift);
 CONVERT(0,1)
 CONVERT(0,2)
 CONVERT(1,0)