diff --git a/icu4c/source/acinclude.m4 b/icu4c/source/acinclude.m4 index 5c8fda71ded..507f41f521c 100644 --- a/icu4c/source/acinclude.m4 +++ b/icu4c/source/acinclude.m4 @@ -464,12 +464,12 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE], then case "${host}" in *-*-solaris*) - # Don't use -std=c99 on Solaris because of timezone check fails + # Don't use -std=c11 on Solaris because of timezone check fails ;; *) # Do not use -ansi. It limits us to C90, and it breaks some platforms. - # We use -std=c99 to disable the gnu99 defaults and its associated warnings - CFLAGS="$CFLAGS -std=c99" + # We use -std=c11 to disable the gnu99 defaults and its associated warnings + CFLAGS="$CFLAGS -std=c11" ;; esac diff --git a/icu4c/source/config/mh-solaris b/icu4c/source/config/mh-solaris index e1d4ccf900f..3d7e6fe79f4 100644 --- a/icu4c/source/config/mh-solaris +++ b/icu4c/source/config/mh-solaris @@ -7,7 +7,7 @@ ## Flags for ICU 59+ CXXFLAGS += -std=c++11 -CFLAGS += -std=c99 +CFLAGS += -std=c11 ## Flags for position independent code SHAREDLIBCFLAGS = -KPIC diff --git a/icu4c/source/configure b/icu4c/source/configure index 56f87c55273..6b7c9c430ed 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -4354,12 +4354,12 @@ $as_echo "$ac_use_strict_options" >&6; } then case "${host}" in *-*-solaris*) - # Don't use -std=c99 on Solaris because of timezone check fails + # Don't use -std=c11 on Solaris because of timezone check fails ;; *) # Do not use -ansi. It limits us to C90, and it breaks some platforms. - # We use -std=c99 to disable the gnu99 defaults and its associated warnings - CFLAGS="$CFLAGS -std=c99" + # We use -std=c11 to disable the gnu99 defaults and its associated warnings + CFLAGS="$CFLAGS -std=c11" ;; esac @@ -7473,15 +7473,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; esac -# GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future. +# GCC >= 4.4 supports UTF16 string literals. As of ICU 62, both C and C++ files require them. if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then if test "$GCC" = yes; then - OLD_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} -std=gnu99" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -static const char16_t test[] = u"This is a UTF16 literal string."; +static const unsigned short test[] = u"This is a UTF16 literal string."; int main () @@ -7498,10 +7496,7 @@ else fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$CC_UTF16_STRING" = 1; then - UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99" CHECK_UTF16_STRING_RESULT="C only"; - else - CFLAGS="${OLD_CFLAGS}" fi fi if test "$GXX" = yes; then diff --git a/icu4c/source/configure.ac b/icu4c/source/configure.ac index a2fdf84ab23..a05f4db4bfe 100644 --- a/icu4c/source/configure.ac +++ b/icu4c/source/configure.ac @@ -1038,19 +1038,14 @@ case "${host}" in ;; esac -# GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future. +# GCC >= 4.4 supports UTF16 string literals. As of spring 2018, all tested compilers support them. if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then if test "$GCC" = yes; then - OLD_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} -std=gnu99" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -static const char16_t test[] = u"This is a UTF16 literal string."; +static const unsigned short test[] = u"This is a UTF16 literal string."; ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0]) if test "$CC_UTF16_STRING" = 1; then - UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99" CHECK_UTF16_STRING_RESULT="C only"; - else - CFLAGS="${OLD_CFLAGS}" fi fi if test "$GXX" = yes; then