comparison make/bsd/makefiles/gcc.make @ 14368:b6ab2c9abfc5

8030350: Enable additional compiler warnings for GCC Reviewed-by: dholmes, coleenp, erikj, tbell, ihse
author mduigou
date Wed, 12 Feb 2014 09:37:18 -0800
parents d16be2b85802
children 2dd7abe7b841
comparison
equal deleted inserted replaced
14366:7907932bdd99 14368:b6ab2c9abfc5
258 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare 258 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
259 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess 259 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
260 WARNINGS_ARE_ERRORS += -Wno-empty-body 260 WARNINGS_ARE_ERRORS += -Wno-empty-body
261 endif 261 endif
262 262
263 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value 263 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wformat=2 -Wno-error=format-nonliteral
264 264
265 ifeq ($(USE_CLANG),) 265 ifeq ($(USE_CLANG),)
266 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit 266 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
267 # conversions which might affect the values. Only enable it in earlier versions. 267 # conversions which might affect the values. Only enable it in earlier versions.
268 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" 268 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
287 CFLAGS += -fno-strict-aliasing 287 CFLAGS += -fno-strict-aliasing
288 288
289 # The flags to use for an Optimized g++ build 289 # The flags to use for an Optimized g++ build
290 ifeq ($(OS_VENDOR), Darwin) 290 ifeq ($(OS_VENDOR), Darwin)
291 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy 291 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
292 # <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers> 292 # <https://wiki.openjdk.java.net/display/MacOSXPort/Compiler+Errata>
293 OPT_CFLAGS_DEFAULT ?= SIZE 293 OPT_CFLAGS_DEFAULT ?= SIZE
294 else 294 else
295 OPT_CFLAGS_DEFAULT ?= SPEED 295 OPT_CFLAGS_DEFAULT ?= SPEED
296 endif 296 endif
297 297