diff options
author | Alexander Graf <agraf@suse.de> | 2013-12-29 17:27:59 +0100 |
---|---|---|
committer | Andreas Färber <andreas.faerber@web.de> | 2014-03-02 18:03:06 +0100 |
commit | 7add40facbbba5580745bdb2337c56ee56514eea (patch) | |
tree | 73a50b4debd81e5c5b38c52f18a3e7d1a538554e | |
parent | a4f796120780245705086b9c73daab0527d1c5b6 (diff) | |
download | qemu-openhackware-7add40facbbba5580745bdb2337c56ee56514eea.tar.gz |
Fix compilation breaking warnings
We compile using -Werror, so warnings cause compile breakage. Unfortunately
there are a number of places in the code that trigger warnings.
This patch fixes a few simple ones and disables two categories of warnings
that would require massive code changes to fix.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/libexec/macho.c | 3 | ||||
-rw-r--r-- | src/main.c | 3 |
3 files changed, 5 insertions, 3 deletions
@@ -45,6 +45,8 @@ SRCDIR:= src CC_BASE:= $(shell $(CC) -print-search-dirs | grep install | sed -e 's/.*\ //') CFLAGS= -Wall -W -Werror -O2 -g -fno-builtin -fno-common -nostdinc -mregnames +# Disable a few warnings that would just create needless code churn +CFLAGS+= -Wno-pointer-sign -Wno-unused-but-set-variable CFLAGS+= -DBUILD_DATE=$(BUILD_DATE) -DBUILD_TIME=$(BUILD_TIME) CFLAGS+= -I$(SRCDIR)/ -I$(SRCDIR)/libc/include -I$(CC_BASE)/include CFLAGS+= -I$(SRCDIR)/dev -I$(SRCDIR)/dev/block -I$(SRCDIR)/dev/char diff --git a/src/libexec/macho.c b/src/libexec/macho.c index ea55892..f07c921 100644 --- a/src/libexec/macho.c +++ b/src/libexec/macho.c @@ -131,6 +131,7 @@ typedef enum load_cmd_t { LC_LOAD_DYLINKER = 0x0E, LC_ID_DYLINKER = 0x0F, LC_PREBOUND_DYLIB = 0x10, + LC_0x17 = 0x17, } load_cmd_t; typedef struct mach_load_cmd_t { @@ -498,7 +499,7 @@ int exec_load_macho (inode_t *file, void **dest, void **entry, void **end, break; case LC_PREBOUND_DYLIB: break; - case 0x17: + case LC_0x17: /* ? */ break; default: @@ -363,7 +363,7 @@ int main (void) void *boot_image, *cmdline, *ramdisk; void *load_base, *load_entry, *last_alloc, *load_end; uint32_t memsize, boot_image_size, cmdline_size, ramdisk_size; - uint32_t boot_base, boot_nb; + uint32_t boot_nb; int boot_device, i; static const uint32_t isa_base_tab[3] = { 0x80000000, /* PREP */ @@ -467,7 +467,6 @@ int main (void) mem_align(0x00001000); res = malloc(0x4000); last_alloc = malloc(0); - boot_base = 0; boot_nb = 0; DPRINTF("Load base: %p - residual data: %p %p %p %p\n", load_base, res, last_alloc, boot_part, part_fs(boot_part)); |