Subject: [alpine-devel] [PATCH] fix some compilation errors with gcc 4.2.4 and musl

From: Pierre Carrier <[email-masked]>
Date: Wed, 17 Oct 2012 02:05:28 -0400

The const return value only issues a warning, but compilation fails
over those.
---
 src/apk_blob.h | 2 +-
 src/blob.c     | 2 +-
 src/common.c   | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/apk_blob.h b/src/apk_blob.h
index e22a2f4..4c8c75e 100644
--- a/src/apk_blob.h
+++ b/src/apk_blob.h
@@ -108,7 +108,7 @@ static inline char *apk_blob_chr(apk_blob_t b, unsigned char ch)
 	return memchr(b.ptr, ch, b.len);
 }
 
-static inline const int apk_checksum_compare(const struct apk_checksum *a,
+static inline int apk_checksum_compare(const struct apk_checksum *a,
 					     const struct apk_checksum *b)
 {
 	return apk_blob_compare(APK_BLOB_PTR_LEN((char *) a->data, a->type),
diff --git a/src/blob.c b/src/blob.c
index a03c66a..fc21467 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -11,7 +11,7 @@
 
 #include <malloc.h>
 #include <string.h>
-#include <printf.h>
+#include <stdio.h>
 
 #include "apk_blob.h"
 #include "apk_hash.h"
diff --git a/src/common.c b/src/common.c
index 36c4d07..5cec5b3 100644
--- a/src/common.c
+++ b/src/common.c
@@ -9,6 +9,7 @@
  */
 
 #include <malloc.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include "apk_defines.h"
-- 
1.7.12.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---