make/autoconf/flags-cflags.m4
changeset 51853 ec62d6cab037
parent 51839 ab54a4d61d7f
child 52351 0ecb4e520110
equal deleted inserted replaced
51852:e240625311ad 51853:ec62d6cab037
   179 
   179 
   180     gcc)
   180     gcc)
   181       DISABLE_WARNING_PREFIX="-Wno-"
   181       DISABLE_WARNING_PREFIX="-Wno-"
   182       CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
   182       CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
   183 
   183 
   184       WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2"
   184       # Additional warnings that are not activated by -Wall and -Wextra
   185       WARNINGS_ENABLE_ADDITIONAL_JVM="-Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -Wreorder -Wreturn-type"
   185       WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare \
       
   186           -Wunused-function -Wundef -Wunused-value -Wreturn-type"
       
   187       WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
       
   188       WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
       
   189       WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
   186 
   190 
   187       DISABLED_WARNINGS="unused-parameter unused"
   191       DISABLED_WARNINGS="unused-parameter unused"
   188 
   192 
   189       # Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
   193       # Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
   190       # CFLAGS since any target specific flags will likely not work with the
   194       # CFLAGS since any target specific flags will likely not work with the
   203 
   207 
   204     clang)
   208     clang)
   205       DISABLE_WARNING_PREFIX="-Wno-"
   209       DISABLE_WARNING_PREFIX="-Wno-"
   206       CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
   210       CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
   207 
   211 
   208       WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2"
   212       # Additional warnings that are not activated by -Wall and -Wextra
   209       WARNINGS_ENABLE_ADDITIONAL_JVM="-Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -Wreorder"
   213       WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare -Wreorder \
       
   214           -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual"
       
   215       WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
   210 
   216 
   211       DISABLED_WARNINGS="unused-parameter unused"
   217       DISABLED_WARNINGS="unused-parameter unused"
       
   218 
       
   219       if test "x$OPENJDK_TARGET_OS" = xmacosx; then
       
   220         # missing-method-return-type triggers in JavaNativeFoundation framework
       
   221         DISABLED_WARNINGS="$DISABLED_WARNINGS missing-method-return-type"
       
   222       fi
       
   223 
   212       ;;
   224       ;;
   213 
   225 
   214     xlc)
   226     xlc)
   215       DISABLE_WARNING_PREFIX="-qsuppress="
   227       DISABLE_WARNING_PREFIX="-qsuppress="
   216       CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"
   228       CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"
   569   fi
   581   fi
   570 
   582 
   571   # CFLAGS WARNINGS STUFF
   583   # CFLAGS WARNINGS STUFF
   572   # Set JVM_CFLAGS warning handling
   584   # Set JVM_CFLAGS warning handling
   573   if test "x$TOOLCHAIN_TYPE" = xgcc; then
   585   if test "x$TOOLCHAIN_TYPE" = xgcc; then
   574     WARNING_CFLAGS_JDK="$WARNINGS_ENABLE_ALL"
   586     WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
   575     WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL $WARNINGS_ENABLE_ADDITIONAL_JVM"
   587     WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
       
   588     WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
   576 
   589 
   577   elif test "x$TOOLCHAIN_TYPE" = xclang; then
   590   elif test "x$TOOLCHAIN_TYPE" = xclang; then
   578     if test "x$OPENJDK_TARGET_OS" = xlinux; then
   591     WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
   579       WARNING_CFLAGS_JDK="$WARNINGS_ENABLE_ALL"
       
   580     else
       
   581       WARNING_CFLAGS_JDK="" # currently left empty
       
   582     fi
       
   583     WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL $WARNINGS_ENABLE_ADDITIONAL_JVM"
       
   584 
   592 
   585   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
   593   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
   586     WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
   594     WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
   587     WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
   595     WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
   588     WARNING_CFLAGS_JVM="" # currently left empty
   596     WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
       
   597 
   589   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
   598   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
   590     WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
   599     WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
       
   600 
   591   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
   601   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
   592     WARNING_CFLAGS=""  # currently left empty
   602     WARNING_CFLAGS=""  # currently left empty
   593   fi
   603   fi
   594 
   604 
   595   # Set some additional per-OS defines.
   605   # Set some additional per-OS defines.