From 3893b1a1b7c2b81723cb2c857f8cd2403c5e3a26 Mon Sep 17 00:00:00 2001
From: Jeff Genovy <29107334+jefgen@users.noreply.github.com>
Date: Wed, 26 Jul 2017 21:13:50 +0000
Subject: [PATCH] ICU-13051 Fix some compiler warnings when building with gcc.

X-SVN-Rev: 40287
---
 icu4c/source/i18n/decimfmtimpl.cpp   | 4 ++--
 icu4c/source/i18n/digitformatter.cpp | 2 +-
 icu4c/source/i18n/uspoof_conf.cpp    | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/icu4c/source/i18n/decimfmtimpl.cpp b/icu4c/source/i18n/decimfmtimpl.cpp
index 4b743960e58..b1f00325da2 100644
--- a/icu4c/source/i18n/decimfmtimpl.cpp
+++ b/icu4c/source/i18n/decimfmtimpl.cpp
@@ -1382,8 +1382,8 @@ DecimalFormatImpl::toNumberPattern(
     DigitInterval maxInterval;
 
     // Only for significant digits
-    int32_t sigMin;
-    int32_t sigMax;
+    int32_t sigMin = 0; /* initialize to avoid compiler warning */
+    int32_t sigMax = 0; /* initialize to avoid compiler warning */
 
     // These are all the digits to be displayed. For significant digits,
     // this interval always starts at the 1's place an extends left.
diff --git a/icu4c/source/i18n/digitformatter.cpp b/icu4c/source/i18n/digitformatter.cpp
index 675b5c429dc..48338850f9c 100644
--- a/icu4c/source/i18n/digitformatter.cpp
+++ b/icu4c/source/i18n/digitformatter.cpp
@@ -177,7 +177,7 @@ UnicodeString &DigitFormatter::format(
     int32_t digitsLeftOfDecimal = interval.getMostSignificantExclusive();
     int32_t lastDigitPos = interval.getLeastSignificantInclusive();
     int32_t intBegin = appendTo.length();
-    int32_t fracBegin;
+    int32_t fracBegin = 0; /* initialize to avoid compiler warning */
 
     // Emit "0" instead of empty string.
     if (digitsLeftOfDecimal == 0 && lastDigitPos == 0) {
diff --git a/icu4c/source/i18n/uspoof_conf.cpp b/icu4c/source/i18n/uspoof_conf.cpp
index f478afad83a..c4002337273 100644
--- a/icu4c/source/i18n/uspoof_conf.cpp
+++ b/icu4c/source/i18n/uspoof_conf.cpp
@@ -396,6 +396,7 @@ void ConfusabledataBuilder::outputData(UErrorCode &status) {
     for (i=0; i<numKeys; i++) {
         int32_t key =  fKeyVec->elementAti(i);
         UChar32 codePoint = ConfusableDataUtils::keyToCodePoint(key);
+        (void)previousCodePoint;    // Suppress unused variable warning.
         // strictly greater because there can be only one entry per code point
         U_ASSERT(codePoint > previousCodePoint);
         keys[i] = key;
-- 
2.40.0