--- a/core/regexp.c
+++ b/core/regexp.c
@@ -23,7 +23,7 @@ int uwsgi_regexp_build(char *re, uwsgi_p
 
 #ifdef UWSGI_PCRE2
 	int errnbr;
-	long unsigned int erroff;
+	size_t erroff;
 
 	*pattern = pcre2_compile((const unsigned char *) re, PCRE2_ZERO_TERMINATED, 0, &errnbr, &erroff, NULL);
 #else
