diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index 8ead0e22d64..dcefc10b81a 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -209,6 +209,13 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS], WARNINGS_ENABLE_ADDITIONAL_JVM="-Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual" DISABLED_WARNINGS="unused-parameter unused" + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + CLANG_VERSION_MAJOR=`echo $CLANG_VERSION_NUMBER | awk -F. '{print $1}'` + # Add "-Wno-deprecated-declarations" and "-Wno-deprecated-non-prototype" on macosx/clang >= 14.x.y + if [ "0$CLANG_VERSION_MAJOR" -gt 13 ]; then + DISABLED_WARNINGS="unused-parameter unused deprecated-declarations deprecated-non-prototype" + fi + fi ;; xlc)