common/autoconf/flags.m4

Print this page
rev 997 : 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
Reviewed-by:

*** 733,738 **** --- 733,754 ---- # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does FLAGS_COMPILER_CHECK_ARGUMENTS([${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) + + case "${TOOLCHAIN_TYPE}" in + microsoft) + CFLAGS_WARNINGS_ARE_ERRORS="/WX" + ;; + solstudio) + CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all" + ;; + gcc) + CFLAGS_WARNINGS_ARE_ERRORS="-Werror" + ;; + clang) + CFLAGS_WARNINGS_ARE_ERRORS="-Werror" + ;; + esac + AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS) ])