Remove compiler warnings when building the emulator.

This forces -Wall during the build. Note that this patch doesn't
remove all warnings, but most of the remaining ones are from upstream anyway.

Change-Id: I8808d8495e99866e156ce5780d2e3c305eab491f
diff --git a/memcheck/memcheck.c b/memcheck/memcheck.c
index 8e0a1f8..3c8194a 100644
--- a/memcheck/memcheck.c
+++ b/memcheck/memcheck.c
@@ -138,7 +138,7 @@
                     }
                     memset(align, ' ', set_align);
                     align[set_align] = '\0';
-                    printf(align);
+                    printf("%s", align);
                     if (inl[index].inlined_in_file == NULL) {
                         printf("inlined to %s in unknown location\n",
                                inl[index].routine_name);
@@ -561,7 +561,7 @@
 memcheck_guest_print_str(target_ulong str) {
     char str_copy[4096];
     memcheck_get_guest_string(str_copy, str, sizeof(str_copy));
-    printf(str_copy);
+    printf("%s", str_copy);
 }
 
 /* Validates read operations, detected in __ldx_mmu routine.
diff --git a/memcheck/memcheck_proc_management.c b/memcheck/memcheck_proc_management.c
index 4120b9f..593ba32 100644
--- a/memcheck/memcheck_proc_management.c
+++ b/memcheck/memcheck_proc_management.c
@@ -25,6 +25,7 @@
 #include "memcheck.h"
 #include "memcheck_proc_management.h"
 #include "memcheck_logging.h"
+#include "memcheck_util.h"
 
 /* Current thread id.
  * This value is updated with each call to memcheck_switch, saving here
diff --git a/memcheck/memcheck_util.c b/memcheck/memcheck_util.c
index cc4182d..5449488 100644
--- a/memcheck/memcheck_util.c
+++ b/memcheck/memcheck_util.c
@@ -102,7 +102,7 @@
      * read / write guest's memory. */
     while (buffer_size) {
         *(uint8_t*)qemu_address = ldub_user(guest_address);
-        (uint32_t)qemu_address++;
+        qemu_address = (uint8_t*)qemu_address + 1;
         guest_address++;
         buffer_size--;
     }
@@ -116,7 +116,7 @@
     while (buffer_size) {
         stb_user(guest_address, *(uint8_t*)qemu_address);
         guest_address++;
-        (uint32_t)qemu_address++;
+        qemu_address = (uint8_t*)qemu_address + 1;
         buffer_size--;
     }
 }
diff --git a/memcheck/memcheck_util.h b/memcheck/memcheck_util.h
index d4f6c8a..b75ee53 100644
--- a/memcheck/memcheck_util.h
+++ b/memcheck/memcheck_util.h
@@ -24,7 +24,7 @@
 #endif  // CONFIG_MEMCHECK
 
 #include "memcheck_common.h"
-#include "elff_api.h"
+#include "elff/elff_api.h"
 
 #ifdef __cplusplus
 extern "C" {