194 endif
195
196 # Keep temporary files (.ii, .s)
197 ifdef NEED_ASM
198 CFLAGS += -save-temps
199 else
200 CFLAGS += -pipe
201 endif
202
203 # Compiler warnings are treated as errors
204 WARNINGS_ARE_ERRORS = -Werror
205
206 ifeq ($(USE_CLANG), true)
207 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
208 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
209 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
210 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
211 WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
212 endif
213
214 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value
215
216 ifeq ($(USE_CLANG),)
217 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
218 # conversions which might affect the values. Only enable it in earlier versions.
219 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
220 WARNING_FLAGS += -Wconversion
221 endif
222 endif
223
224 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
225 # Special cases
226 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
227
228 # The flags to use for an Optimized g++ build
229 OPT_CFLAGS/SIZE=-Os
230 OPT_CFLAGS/SPEED=-O3
231
232 # Hotspot uses very unstrict aliasing turn this optimization off
233 # This option is added to CFLAGS rather than OPT_CFLAGS
234 # so that OPT_CFLAGS overrides get this option too.
|
194 endif
195
196 # Keep temporary files (.ii, .s)
197 ifdef NEED_ASM
198 CFLAGS += -save-temps
199 else
200 CFLAGS += -pipe
201 endif
202
203 # Compiler warnings are treated as errors
204 WARNINGS_ARE_ERRORS = -Werror
205
206 ifeq ($(USE_CLANG), true)
207 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
208 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
209 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
210 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
211 WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
212 endif
213
214 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wreturn-type
215
216 ifeq ($(USE_CLANG),)
217 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
218 # conversions which might affect the values. Only enable it in earlier versions.
219 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
220 WARNING_FLAGS += -Wconversion
221 endif
222 endif
223
224 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
225 # Special cases
226 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
227
228 # The flags to use for an Optimized g++ build
229 OPT_CFLAGS/SIZE=-Os
230 OPT_CFLAGS/SPEED=-O3
231
232 # Hotspot uses very unstrict aliasing turn this optimization off
233 # This option is added to CFLAGS rather than OPT_CFLAGS
234 # so that OPT_CFLAGS overrides get this option too.
|