Skip to content

Commit

Permalink
8292008: Transition the JDK to the common standard of C11
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
magicus committed Aug 31, 2022
1 parent 6f29734 commit 6076128
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
CFLAGS_WARNINGS_ARE_ERRORS="-WX"
WARNINGS_ENABLE_ALL="-W3"
DISABLED_WARNINGS="4800"
DISABLED_WARNINGS="4800 5105"
;;
gcc)
Expand Down Expand Up @@ -535,20 +535,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
fi
# CFLAGS C language level for JDK sources (hotspot only uses C++)
# Ideally we would have a common level across all toolchains so that all sources
# are sure to conform to the same standard. Unfortunately neither our sources nor
# our toolchains are in a condition to support that. But what we loosely aim for is
# C99 level.
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
# Explicitly set C99. clang and xlclang support the same flag.
LANGSTD_CFLAGS="-std=c99"
LANGSTD_CFLAGS="-std=c11"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# MSVC doesn't support C99/C11 explicitly, unless you compile as C++:
# LANGSTD_CFLAGS="-TP"
# but that requires numerous changes to the sources files. So we are limited
# to C89/C90 plus whatever extensions Visual Studio has decided to implement.
# This is the lowest bar for shared code.
LANGSTD_CFLAGS=""
LANGSTD_CFLAGS="-std:c11"
fi
TOOLCHAIN_CFLAGS_JDK_CONLY="$LANGSTD_CFLAGS $TOOLCHAIN_CFLAGS_JDK_CONLY"
Expand Down

1 comment on commit 6076128

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.