From 7add40facbbba5580745bdb2337c56ee56514eea Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sun, 29 Dec 2013 17:27:59 +0100 Subject: Fix compilation breaking warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Andreas Färber --- Makefile | 2 ++ src/libexec/macho.c | 3 ++- src/main.c | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a45674a..c0213b2 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/src/main.c b/src/main.c index ad80833..2d61d64 100644 --- a/src/main.c +++ b/src/main.c @@ -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)); -- cgit v1.2.1