From cdc1423478cc2827da7752b5c53243667e93ddc1 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Thu, 1 May 2014 08:55:31 -0700 Subject: [PATCH] Bug 1003702 - Suppress clang warnings in third-party code: ICU. Now with more clobberin'. r=glandium --HG-- extra : amend_source : 8fff21a02daafc582a458887fd55ad6c0eb3e97a --- CLOBBER | 4 +- intl/icu-patches/suppress-warnings.diff | 80 +++++++++++++++++++++++++ intl/icu/source/acinclude.m4 | 6 ++ intl/icu/source/configure | 6 ++ intl/update-icu.sh | 1 + 5 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 intl/icu-patches/suppress-warnings.diff diff --git a/CLOBBER b/CLOBBER index 032a934f2f9..9366e8e4af1 100644 --- a/CLOBBER +++ b/CLOBBER @@ -1,4 +1,4 @@ -# To Trigger a clobber replace ALL of the textual description below, +# To trigger a clobber replace ALL of the textual description below, # giving a bug number and a one line description of why a clobber is # required. Modifying this file will make configure check that a # clobber has been performed before the build can continue. @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Bug 1003702 - ICU is unhappy. +Bug 1003702 - Relanding ICU changes with a clobber diff --git a/intl/icu-patches/suppress-warnings.diff b/intl/icu-patches/suppress-warnings.diff new file mode 100644 index 00000000000..65eef53a975 --- /dev/null +++ b/intl/icu-patches/suppress-warnings.diff @@ -0,0 +1,80 @@ +diff --git a/intl/icu/source/acinclude.m4 b/intl/icu/source/acinclude.m4 +--- a/intl/icu/source/acinclude.m4 ++++ b/intl/icu/source/acinclude.m4 +@@ -466,30 +466,36 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE], + *) + # 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" + ;; + esac + + CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" ++ ++ # Suppress clang C warnings: ++ CFLAGS="$CFLAGS -Wno-sign-compare -Wno-unused" + else + case "${host}" in + *-*-cygwin) + if test "`$CC /help 2>&1 | head -c9`" = "Microsoft" + then + CFLAGS="$CFLAGS /W4" + fi ;; + *-*-mingw32|*-*-mingw64) + CFLAGS="$CFLAGS -W4" ;; + esac + fi + if test "$GXX" = yes + then + CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long" ++ ++ # Suppress clang C++ warnings: ++ CXXFLAGS="$CXXFLAGS -Wno-unused -Wno-unused-parameter" + else + case "${host}" in + *-*-cygwin) + if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft" + then + CXXFLAGS="$CXXFLAGS /W4" + fi ;; + *-*-mingw32|*-*-mingw64) +diff --git a/intl/icu/source/configure b/intl/icu/source/configure +--- a/intl/icu/source/configure ++++ b/intl/icu/source/configure +@@ -4089,30 +4089,36 @@ fi + *) + # 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" + ;; + esac + + CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" ++ ++ # Suppress clang C warnings: ++ CFLAGS="$CFLAGS -Wno-sign-compare -Wno-unused" + else + case "${host}" in + *-*-cygwin) + if test "`$CC /help 2>&1 | head -c9`" = "Microsoft" + then + CFLAGS="$CFLAGS /W4" + fi ;; + *-*-mingw32|*-*-mingw64) + CFLAGS="$CFLAGS -W4" ;; + esac + fi + if test "$GXX" = yes + then + CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long" ++ ++ # Suppress clang C++ warnings: ++ CXXFLAGS="$CXXFLAGS -Wno-unused -Wno-unused-parameter" + else + case "${host}" in + *-*-cygwin) + if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft" + then + CXXFLAGS="$CXXFLAGS /W4" + fi ;; + *-*-mingw32|*-*-mingw64) diff --git a/intl/icu/source/acinclude.m4 b/intl/icu/source/acinclude.m4 index 1b234efa558..560fce8cf2c 100644 --- a/intl/icu/source/acinclude.m4 +++ b/intl/icu/source/acinclude.m4 @@ -471,6 +471,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE], esac CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" + + # Suppress clang C warnings: + CFLAGS="$CFLAGS -Wno-sign-compare -Wno-unused" else case "${host}" in *-*-cygwin) @@ -485,6 +488,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE], if test "$GXX" = yes then CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long" + + # Suppress clang C++ warnings: + CXXFLAGS="$CXXFLAGS -Wno-unused -Wno-unused-parameter" else case "${host}" in *-*-cygwin) diff --git a/intl/icu/source/configure b/intl/icu/source/configure index 8b2a96d7572..022f2682c3e 100755 --- a/intl/icu/source/configure +++ b/intl/icu/source/configure @@ -4094,6 +4094,9 @@ $as_echo "$ac_use_strict_options" >&6; } esac CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" + + # Suppress clang C warnings: + CFLAGS="$CFLAGS -Wno-sign-compare -Wno-unused" else case "${host}" in *-*-cygwin) @@ -4108,6 +4111,9 @@ $as_echo "$ac_use_strict_options" >&6; } if test "$GXX" = yes then CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long" + + # Suppress clang C++ warnings: + CXXFLAGS="$CXXFLAGS -Wno-unused -Wno-unused-parameter" else case "${host}" in *-*-cygwin) diff --git a/intl/update-icu.sh b/intl/update-icu.sh index 6ede56835fd..7d4d751b69f 100755 --- a/intl/update-icu.sh +++ b/intl/update-icu.sh @@ -55,5 +55,6 @@ patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-899722-4 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-915735 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/genrb-omitCollationRules.diff patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/qualify-uinitonce-windows.diff +patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/suppress-warnings.diff hg addremove ${icu_dir}