Restore compilation flags.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 15 Oct 2008 19:54:39 +0000 (21:54 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 15 Oct 2008 19:54:39 +0000 (21:54 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
common/common.c
common/common.h
mk/cflags.mk
mk/common.mk

index 9fdf961..63f0d9a 100644 (file)
@@ -286,9 +286,9 @@ ARRAY(exitcall_t)
 
 static A(exitcall_t) __exit = ARRAY_INIT;
 
 
 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)
 }
 
 static void common_shutdown(void)
index 40eb0a2..5e6757b 100644 (file)
@@ -63,7 +63,7 @@
 typedef int  (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
 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)                                                        \
 void common_init(void);
 
 #define module_init(fn)                                                        \
index 07f1870..39ee204 100644 (file)
@@ -32,6 +32,9 @@
 ifneq ($(filter 4.%,$(shell gcc -dumpversion)),)
   GCC4=1
 endif
 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
 
 # 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
 # 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
 # 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
 # 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.
 # warn if the format string is not a string literal
 CFLAGS += -Wformat-nonliteral
 # do not warn about zero-length formats.
index 4e4be6f..3db3ee8 100644 (file)
@@ -1,8 +1,8 @@
 include ../mk/cflags.mk
 
 prefix ?= /usr/local
 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))
 
 
 INSTALL_PROGS = $(addprefix install-,$(PROGRAMS))