diff --git a/encoding.c b/encoding.c
index ee33df1..a912d63 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1703,7 +1703,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
     }
     icv_inlen = *inlen;
     icv_outlen = *outlen;
-    ret = iconv(cd, (char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
+    ret = iconv(cd, (const char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
     *inlen -= icv_inlen;
     *outlen -= icv_outlen;
     if ((icv_inlen != 0) || (ret == -1)) {
diff --git a/threads.c b/threads.c
index 87d0d36..c79a0a9 100644
--- a/threads.c
+++ b/threads.c
@@ -428,7 +428,6 @@ __xmlGlobalInitMutexLock(void)
 {
     /* Make sure the global init lock is initialized and then lock it. */
 #ifdef HAVE_PTHREAD_H
-    int err;
 
     /* The mutex is statically initialized, so we just lock it. */
     pthread_mutex_lock(&global_init_lock);
diff --git a/tree.c b/tree.c
index ffbcabd..1a292fc 100644
--- a/tree.c
+++ b/tree.c
@@ -4848,7 +4848,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) {
     fixed = xmlPathToURI(uri);
     if (fixed != NULL) {
 	xmlSetNsProp(cur, ns, BAD_CAST "base", fixed);
-	xmlFree(fixed);
+	xmlFree((char *) fixed);
     } else {
 	xmlSetNsProp(cur, ns, BAD_CAST "base", uri);
     }
diff --git a/xmlsave.c b/xmlsave.c
index 231ee7b..b97327e 100644
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -834,7 +834,6 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) {
     xmlCharEncodingOutputFunc oldescape = ctxt->escape;
     xmlCharEncodingOutputFunc oldescapeAttr = ctxt->escapeAttr;
     xmlOutputBufferPtr buf = ctxt->buf;
-    xmlCharEncodingHandlerPtr handler = NULL;
     xmlCharEncoding enc;
 
     xmlInitParser();
