make/linux/makefiles/gcc.make

Print this page




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




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