projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
strict aliasing generates too many bugs
[apps/pfixtools.git]
/
mk
/
cflags.mk
diff --git
a/mk/cflags.mk
b/mk/cflags.mk
index
e4f5b8b
..
c184d9a
100644
(file)
--- a/
mk/cflags.mk
+++ b/
mk/cflags.mk
@@
-1,5
+1,5
@@
##############################################################################
##############################################################################
-# p
ostlicyd: a postfix policy daemon with a lot of features
#
+# p
fixtools: a collection of postfix related tools
#
# ~~~~~~~~~ #
# ________________________________________________________________________ #
# #
# ~~~~~~~~~ #
# ________________________________________________________________________ #
# #
@@
-32,57
+32,58
@@
ifneq ($(filter 4.%,$(shell gcc -dumpversion)),)
GCC4=1
endif
ifneq ($(filter 4.%,$(shell gcc -dumpversion)),)
GCC4=1
endif
-
-LDFLAGS += -Wl,--warn-common
-
-CFLAGS := -g
+ifneq ($(filter Darwin%,$(shell uname)),)
+ DARWIN=1
+endif
# Use pipes and not temp files.
# Use pipes and not temp files.
-CFLAGS += -pipe
+CFLAGS
BASE
+= -pipe
# optimize even more
# optimize even more
-CFLAGS += -O2
+CFLAGS
BASE
+= -O2
# let the type char be unsigned by default
# let the type char be unsigned by default
-CFLAGS += -funsigned-char
-CFLAGS
+= -f
strict-aliasing
+CFLAGS
BASE
+= -funsigned-char
+CFLAGS
BASE += -fno-
strict-aliasing
# turn on all common warnings
# turn on all common warnings
-CFLAGS += -Wall
+CFLAGS
BASE
+= -Wall
# turn on extra warnings
# turn on extra warnings
-CFLAGS += $(if $(GCC4),-Wextra,-W)
+CFLAGS
BASE
+= $(if $(GCC4),-Wextra,-W)
# treat warnings as errors
# treat warnings as errors
-CFLAGS += -Werror
-CFLAGS += -Wchar-subscripts
+CFLAGS
BASE
+= -Werror
+CFLAGS
BASE
+= -Wchar-subscripts
# warn about undefined preprocessor identifiers
# warn about undefined preprocessor identifiers
-CFLAGS += -Wundef
+CFLAGS
BASE
+= -Wundef
# warn about local variable shadowing another local variable
# warn about local variable shadowing another local variable
-CFLAGS += -Wshadow
+# # disabled on Darwin because of warnings in ev.h
+CFLAGSBASE += -Wshadow
# warn about casting of pointers to increased alignment requirements
# warn about casting of pointers to increased alignment requirements
-CFLAGS += -Wcast-align
+CFLAGS
BASE
+= -Wcast-align
# make string constants const
# make string constants const
-CFLAGS += -Wwrite-strings
+CFLAGS
BASE
+= -Wwrite-strings
# warn about implicit conversions with side effects
# fgets, calloc and friends take an int, not size_t...
# warn about implicit conversions with side effects
# fgets, calloc and friends take an int, not size_t...
-#CFLAGS += -Wconversion
+#CFLAGS
BASE
+= -Wconversion
# warn about comparisons between signed and unsigned values
# warn about comparisons between signed and unsigned values
-CFLAGS += -Wsign-compare
+CFLAGS
BASE
+= -Wsign-compare
# warn about unused declared stuff
# warn about unused declared stuff
-CFLAGS += -Wunused
-CFLAGS += -Wno-unused-parameter
+CFLAGS
BASE
+= -Wunused
+CFLAGS
BASE
+= -Wno-unused-parameter
# warn about variable use before initialization
# warn about variable use before initialization
-CFLAGS += -Wuninitialized
+CFLAGS
BASE
+= -Wuninitialized
# warn about variables which are initialized with themselves
# warn about variables which are initialized with themselves
-CFLAGS
+= -Winit-self
+CFLAGS
BASE += $(if $(GCC4),-Winit-self)
# warn about pointer arithmetic on void* and function pointers
# warn about pointer arithmetic on void* and function pointers
-CFLAGS += -Wpointer-arith
+CFLAGS
BASE
+= -Wpointer-arith
# warn about multiple declarations
# warn about multiple declarations
-CFLAGS += -Wredundant-decls
+# #disabled on Darwin because of warnings in ev.h
+CFLAGSBASE += -Wredundant-decls
# warn if the format string is not a string literal
# warn if the format string is not a string literal
-CFLAGS += -Wformat-nonliteral
+CFLAGS
BASE
+= -Wformat-nonliteral
# do not warn about zero-length formats.
# do not warn about zero-length formats.
-CFLAGS += -Wno-format-zero-length
-#
missing prototyp
es
-CFLAGS
+= -Wmissing-prototypes
+CFLAGS
BASE
+= -Wno-format-zero-length
+#
do not warn about strftime format with y2k issu
es
+CFLAGS
BASE += -Wno-format-y2k
# warn about functions without format attribute that should have one
# warn about functions without format attribute that should have one
-CFLAGS += -Wmissing-format-attribute
-# barf if we change constness
-#CFLAGS += -Wcast-qual
+CFLAGSBASE += -Wmissing-format-attribute
+CFLAGS=$(CFLAGSBASE)
+LDFLAGS=$(LDFLAGSBASE)