]> granicus.if.org Git - icu/commitdiff
ICU-13670 Changing CFLAGS to C11 and fixing check for unicode string literals.
authorShane Carr <shane@unicode.org>
Mon, 23 Apr 2018 21:16:52 +0000 (21:16 +0000)
committerShane Carr <shane@unicode.org>
Mon, 23 Apr 2018 21:16:52 +0000 (21:16 +0000)
X-SVN-Rev: 41263

icu4c/source/acinclude.m4
icu4c/source/config/mh-solaris
icu4c/source/configure
icu4c/source/configure.ac

index 5c8fda71dede219caf16e82302f57e1d8537fb2a..507f41f521c52d3d2d71dcedc5366180316dcb79 100644 (file)
@@ -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
             
index e1d4ccf900fc10d3ff04880634435db1eddb848c..3d7e6fe79f445764694d84de0edee4d0e7942b1e 100644 (file)
@@ -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
index 56f87c55273fba0b26914e134af84382019976d6..6b7c9c430edd8cdd95d35346b013e831e37b47ff 100755 (executable)
@@ -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
index a2fdf84ab2350f7ea5e818ea1c908f70b492006e..a05f4db4bfe21ea6271b4e12cf9f9b68c8aced2c 100644 (file)
@@ -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