< prev index next >

make/linux/makefiles/gcc.make

Print this page
rev 9081 : imported patch more.patch


 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     # GCC < 4.3
 217     WARNING_FLAGS += -Wconversion
 218   endif  
 219   ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
 220     # GCC >= 4.8
 221     # This flag is only known since GCC 4.3. Gcc 4.8 contains a fix so that with templates no
 222     # warnings are issued: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
 223     WARNING_FLAGS += -Wtype-limits
 224     # GCC < 4.8 don't accept this flag for C++.
 225     WARNING_FLAGS += -Wno-format-zero-length


 226   endif
 227 endif
 228 
 229 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
 230 
 231 # Special cases
 232 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
 233 
 234 # optimization control flags (Used by fastdebug and release variants)
 235 OPT_CFLAGS/NOOPT=-O0
 236 OPT_CFLAGS/DEBUG=-O0
 237 OPT_CFLAGS/SIZE=-Os
 238 OPT_CFLAGS/SPEED=-O3
 239 
 240 OPT_CFLAGS_DEFAULT ?= SPEED
 241 
 242 # Hotspot uses very unstrict aliasing turn this optimization off
 243 # This option is added to CFLAGS rather than OPT_CFLAGS
 244 # so that OPT_CFLAGS overrides get this option too.
 245 CFLAGS += -fno-strict-aliasing




 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     # GCC < 4.3
 217     WARNING_FLAGS += -Wconversion
 218   endif  
 219   ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
 220     # GCC >= 4.8
 221     # This flag is only known since GCC 4.3. Gcc 4.8 contains a fix so that with templates no
 222     # warnings are issued: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
 223     WARNING_FLAGS += -Wtype-limits
 224     # GCC < 4.8 don't accept this flag for C++.
 225     WARNING_FLAGS += -Wno-format-zero-length
 226     # GCC 4.8 reports less false positives than the older compilers.
 227     WARNING_FLAGS += -Wuninitialized
 228   endif
 229 endif
 230 
 231 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
 232 
 233 # Special cases
 234 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
 235 
 236 # optimization control flags (Used by fastdebug and release variants)
 237 OPT_CFLAGS/NOOPT=-O0
 238 OPT_CFLAGS/DEBUG=-O0
 239 OPT_CFLAGS/SIZE=-Os
 240 OPT_CFLAGS/SPEED=-O3
 241 
 242 OPT_CFLAGS_DEFAULT ?= SPEED
 243 
 244 # Hotspot uses very unstrict aliasing turn this optimization off
 245 # This option is added to CFLAGS rather than OPT_CFLAGS
 246 # so that OPT_CFLAGS overrides get this option too.
 247 CFLAGS += -fno-strict-aliasing


< prev index next >