hotspot/make/linux/makefiles/gcc.make
changeset 33142 399fdb935d28
parent 33105 294e48b4f704
child 33466 ca5ee1f94b60
child 33589 7cbd1b2c139b
equal deleted inserted replaced
33141:79da1ca44622 33142:399fdb935d28
   205   WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
   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
   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
   207   WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
   208 endif
   208 endif
   209 
   209 
   210 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual -Wno-format-zero-length
   210 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
   211 
   211 
   212 ifeq ($(USE_CLANG),)
   212 ifeq ($(USE_CLANG),)
   213   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
   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.
   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"
   215   ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
       
   216     # GCC < 4.3
   216     WARNING_FLAGS += -Wconversion
   217     WARNING_FLAGS += -Wconversion
   217   endif  
   218   endif  
   218   ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
   219   ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
       
   220     # GCC >= 4.8
   219     # This flag is only known since GCC 4.3. Gcc 4.8 contains a fix so that with templates no
   221     # 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
   222     # warnings are issued: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
   221     WARNING_FLAGS += -Wtype-limits
   223     WARNING_FLAGS += -Wtype-limits
       
   224     # GCC < 4.8 don't accept this flag for C++.
       
   225     WARNING_FLAGS += -Wno-format-zero-length
   222   endif
   226   endif
   223 endif
   227 endif
   224 
   228 
   225 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
   229 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
   226 
   230