From 84bb99c3a5a18d3471607db1c8af880b40158572 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 15 Oct 2008 21:54:39 +0200 Subject: [PATCH] Restore compilation flags. Signed-off-by: Florent Bruneau --- common/common.c | 4 ++-- common/common.h | 2 +- mk/cflags.mk | 9 +++++++-- mk/common.mk | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/common/common.c b/common/common.c index 9fdf961..63f0d9a 100644 --- a/common/common.c +++ b/common/common.c @@ -286,9 +286,9 @@ ARRAY(exitcall_t) static A(exitcall_t) __exit = ARRAY_INIT; -void common_register_exit(exitcall_t _exit) +void common_register_exit(exitcall_t exitcall) { - array_add(__exit, _exit); + array_add(__exit, exitcall); } static void common_shutdown(void) diff --git a/common/common.h b/common/common.h index 40eb0a2..5e6757b 100644 --- a/common/common.h +++ b/common/common.h @@ -63,7 +63,7 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); -void common_register_exit(exitcall_t _exit); +void common_register_exit(exitcall_t exitcall); void common_init(void); #define module_init(fn) \ diff --git a/mk/cflags.mk b/mk/cflags.mk index 07f1870..39ee204 100644 --- a/mk/cflags.mk +++ b/mk/cflags.mk @@ -32,6 +32,9 @@ ifneq ($(filter 4.%,$(shell gcc -dumpversion)),) GCC4=1 endif +ifneq ($(filter Darwin%,$(shell uname)),) + DARWIN=1 +endif # Use pipes and not temp files. CFLAGS += -pipe @@ -50,7 +53,8 @@ CFLAGS += -Wchar-subscripts # warn about undefined preprocessor identifiers CFLAGS += -Wundef # warn about local variable shadowing another local variable -#CFLAGS += -Wshadow +# # disabled on Darwin because of warnings in ev.h +CFLAGS += $(if $(DARWIN),,-Wshadow) # warn about casting of pointers to increased alignment requirements CFLAGS += -Wcast-align # make string constants const @@ -70,7 +74,8 @@ CFLAGS += $(if $(GCC4),-Winit-self) # warn about pointer arithmetic on void* and function pointers CFLAGS += -Wpointer-arith # warn about multiple declarations -#CFLAGS += -Wredundant-decls +# #disabled on Darwin because of warnings in ev.h +CFLAGS += $(if $(DARWIN),,-Wredundant-decls) # warn if the format string is not a string literal CFLAGS += -Wformat-nonliteral # do not warn about zero-length formats. diff --git a/mk/common.mk b/mk/common.mk index 4e4be6f..3db3ee8 100644 --- a/mk/common.mk +++ b/mk/common.mk @@ -1,8 +1,8 @@ include ../mk/cflags.mk prefix ?= /usr/local -LDFLAGS += -L/opt/local/lib -CFLAGS += --std=gnu99 -I../ -I../common -I/opt/local/include +LDFLAGS += $(if $(DARWIN),-L/opt/local/lib,-Wl,-warn-common) +CFLAGS += --std=gnu99 -I../ -I../common $(if $(DARWIN),-I/opt/local/include,) INSTALL_PROGS = $(addprefix install-,$(PROGRAMS)) -- 2.20.1