190 endif
191
192 # Keep temporary files (.ii, .s)
193 ifdef NEED_ASM
194 CFLAGS += -save-temps
195 else
196 CFLAGS += -pipe
197 endif
198
199 # Compiler warnings are treated as errors
200 WARNINGS_ARE_ERRORS = -Werror
201
202 ifeq ($(USE_CLANG), true)
203 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
204 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
205 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
206 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
207 WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
208 endif
209
210 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
211
212 ifeq ($(USE_CLANG),)
213 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
214 # conversions which might affect the values. Only enable it in earlier versions.
215 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
216 WARNING_FLAGS += -Wconversion
217 endif
218 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
219 # This flag is only known since GCC 4.3. Gcc 4.8 contains a fix so that with templates no
220 # warnings are issued: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
221 WARNING_FLAGS += -Wtype-limits
222 endif
223 endif
224
225 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
226
227 # Special cases
228 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
229
230 # optimization control flags (Used by fastdebug and release variants)
|
190 endif
191
192 # Keep temporary files (.ii, .s)
193 ifdef NEED_ASM
194 CFLAGS += -save-temps
195 else
196 CFLAGS += -pipe
197 endif
198
199 # Compiler warnings are treated as errors
200 WARNINGS_ARE_ERRORS = -Werror
201
202 ifeq ($(USE_CLANG), true)
203 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
204 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
205 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
206 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
207 WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
208 endif
209
210 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual -Wno-format-zero-length
211
212 ifeq ($(USE_CLANG),)
213 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
214 # conversions which might affect the values. Only enable it in earlier versions.
215 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
216 WARNING_FLAGS += -Wconversion
217 endif
218 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
219 # This flag is only known since GCC 4.3. Gcc 4.8 contains a fix so that with templates no
220 # warnings are issued: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
221 WARNING_FLAGS += -Wtype-limits
222 endif
223 endif
224
225 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
226
227 # Special cases
228 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
229
230 # optimization control flags (Used by fastdebug and release variants)
|