]> granicus.if.org Git - icu/commitdiff
ICU-10048 Compiler warning cleanup.
authorAndy Heninger <andy.heninger@gmail.com>
Thu, 21 Mar 2013 05:48:52 +0000 (05:48 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Thu, 21 Mar 2013 05:48:52 +0000 (05:48 +0000)
X-SVN-Rev: 33445

17 files changed:
icu4c/source/test/cintltst/cldrtest.c
icu4c/source/test/cintltst/cnumtst.c
icu4c/source/test/cintltst/crestst.c
icu4c/source/test/cintltst/creststn.c
icu4c/source/test/cintltst/cstrcase.c
icu4c/source/test/cintltst/custrtrn.c
icu4c/source/test/cintltst/eurocreg.c
icu4c/source/test/cintltst/idnatest.c
icu4c/source/test/cintltst/reapits.c
icu4c/source/test/cintltst/tracetst.c
icu4c/source/test/cintltst/utexttst.c
icu4c/source/test/cintltst/utmstest.c
icu4c/source/test/intltest/calregts.cpp
icu4c/source/test/intltest/dcfmtest.cpp
icu4c/source/test/iotest/filetst.c
icu4c/source/tools/ctestfw/ctest.c
icu4c/source/tools/toolutil/package.cpp

index fe71a7c001c7eb23b8d27c3d6621d1c104abea8d..027a2b374ba309c02b56d2f39ef0861ec0457222 100644 (file)
@@ -83,6 +83,7 @@ TestKeyInRootRecursive(UResourceBundle *root, const char *rootName,
 
         errorCode = U_ZERO_ERROR;
         currentBundleKey = ures_getKey(currentBundle);
+        (void)currentBundleKey;    /* Suppress set but not used warning. */
         subBundle = ures_getNextResource(currentBundle, NULL, &errorCode);
         if (U_FAILURE(errorCode)) {
             log_err("Can't open a resource for lnocale %s. Error: %s\n", locale, u_errorName(errorCode));
@@ -314,6 +315,7 @@ TestKeyInRootRecursive(UResourceBundle *root, const char *rootName,
                                 locale);
                     }
                 }
+                (void)sameArray;    /* Suppress set but not used warning. */
 /*                if (sameArray && strcmp(rootName, "root") == 0) {
                     log_err("Arrays are the same with key \"%s\" in \"%s\" from root for locale \"%s\"\n",
                             subBundleKey,
index 46964af9d5394188e9d963f01ef0be7b3dd46ff3..3bc0005406c8381c04c7069f0c74661f738add53 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /********************************************************************************
@@ -104,6 +104,7 @@ static void TestInt64Parse()
     log_verbose("About to test unum_parseInt64() with out of range number\n");
 
     a = unum_parseInt64(nf, text, size, 0, status);
+    (void)a;     /* Suppress set but not used warning. */
 
 
     if(!U_FAILURE(*status))
index a5c5a4d9790e4be71ed906fdb80cb13693e28a83..fc6e4bfd72d7b73ba83fc767367c1f1157b9cfcb 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2010, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /*******************************************************************************
@@ -438,6 +438,7 @@ static void TestFallback()
 
     /* clear it out..  just do some calls to get the gears turning */
     junk = ures_getStringByKey(fr_FR, "LocaleID", &resultLen, &status);
+    (void)junk;    /* Suppress set but not used warning. */
     status = U_ZERO_ERROR;
     junk = ures_getStringByKey(fr_FR, "LocaleString", &resultLen, &status);
     status = U_ZERO_ERROR;
index b15bd90a5cf514314ce884fe8a5b9549b4864e46..2730a218188d400dcf978bdfa34128a942020059 100644 (file)
@@ -768,7 +768,7 @@ static void TestEmptyTypes() {
     int32_t len = 0;
     int32_t intResult = 0;
     const UChar *zeroString;
-    const int32_t *zeroIntVect;
+    const int32_t *zeroIntVect = NULL;
 
     strcpy(action, "Construction of testtypes bundle");
     testdatapath=loadTestData(&status);
@@ -843,6 +843,7 @@ static void TestEmptyTypes() {
     }
     else {
         zeroIntVect=ures_getIntVector(res, &len, &status);
+        (void)zeroIntVect;    /* Suppress set but not used warning. */
         if(!U_SUCCESS(status) || resArray != NULL || len != 0) {
             log_err("Shouldn't get emptyintv\n");
         }
@@ -859,6 +860,7 @@ static void TestEmptyTypes() {
     }
     else {
         binResult=ures_getBinary(res, &len, &status);
+        (void)binResult;      /* Suppress set but not used warning. */
         if(!U_SUCCESS(status) || len != 0) {
             log_err("Couldn't get emptybin, or it's not empty\n");
         }
@@ -964,6 +966,7 @@ static void TestBinaryCollationData(){
             CONFIRM_ErrorCode(status, U_ZERO_ERROR);
             CONFIRM_INT_EQ(ures_getType(binColl), URES_BINARY);
             binResult=(uint8_t*)ures_getBinary(binColl,  &len, &status);
+            (void)binResult;    /* Suppress set but not used warning. */
             if(U_SUCCESS(status)){
                 CONFIRM_ErrorCode(status, U_ZERO_ERROR);
                 CONFIRM_INT_GE(len, 1);
@@ -1056,6 +1059,7 @@ static void TestAPI() {
     teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status);
     key=ures_getKey(teFillin);
     value=(UChar*)ures_getNextString(teFillin, &len, &key, &status);
+    (void)value;    /* Suppress set but not used warning. */
     ures_resetIterator(NULL);
     value=(UChar*)ures_getNextString(teFillin, &len, &key, &status);
     if(status !=U_INDEX_OUTOFBOUNDS_ERROR){
@@ -2035,6 +2039,7 @@ static void TestFallback()
     status = U_ZERO_ERROR;
     junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status);
     status = U_ZERO_ERROR;
+    (void)junk;    /* Suppress set but not used warning. */
 
     /* OK first one. This should be a Default value. */
     subResource = ures_getByKey(fr_FR, "MeasurementSystem", NULL, &status);
@@ -2629,6 +2634,7 @@ static void TestGetFunctionalEquivalent(void) {
         len = ures_getFunctionalEquivalent(equivLocale, 255, U_ICUDATA_COLL,
             "calendar", "calendar", "ar_EG@calendar=islamic", 
             &gotAvail, FALSE, &status);
+        (void)len;    /* Suppress set but not used warning. */
 
         if(status == U_MISSING_RESOURCE_ERROR) {
             log_verbose("PASS: Got expected U_MISSING_RESOURCE_ERROR\n");
@@ -2944,6 +2950,7 @@ TestGetUTF8String() {
     status = U_ZERO_ERROR;
     length8 = (int32_t)sizeof(buffer8);
     s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status);
+    (void)s8;    /* Suppress set but not used warning. */
     if(status != U_ZERO_ERROR) {
         log_err("ures_getUTF8StringByKey(testdata/root string) malfunctioned - %s\n", u_errorName(status));
     }
index 4aa5c7585c81b63848aa90eda4811124385ec2c1..41fc542611cc23539972323da059b1bda013a83a 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2002-2009, International Business Machines
+*   Copyright (C) 2002-2013, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -639,12 +639,14 @@ TestCaseCompare(void) {
 
     lenMixed=u_strlen(mixed);
     lenOtherDefault=u_strlen(otherDefault);
+    (void)lenOtherDefault;    /* Suppress set but not used warning. */
     lenOtherExcludeSpecialI=u_strlen(otherExcludeSpecialI);
     lenDifferent=u_strlen(different);
 
     /* if unicodeVersion()>=3.1 then test exclude-special-i cases as well */
     u_getUnicodeVersion(unicodeVersion);
     isUnicode_3_1= uprv_memcmp(unicodeVersion, unicode_3_1, 4)>=0;
+    (void)isUnicode_3_1;    /* Suppress set but not used warning. */
 
     /* test u_strcasecmp() */
     result=u_strcasecmp(mixed, otherDefault, U_FOLD_CASE_DEFAULT);
index 34302375e18dfffdacfce5d07e63251f47d4f864..3b347f359feb823c3cdcbcaa7e39df8133092232 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (c) 2001-2011, International Business Machines Corporation and
+ * Copyright (c) 2001-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /********************************************************************************
@@ -1404,6 +1404,7 @@ static void Test_widestrs()
         err = U_ZERO_ERROR;
         wl = (int32_t)uprv_wcslen(wcs);
         cp = u_strFromWCS(rts, rtcap, &rtl, wcs, wl, &err);
+        (void)cp;    /* Suppress set but not used warning. */
         if (U_FAILURE(err)) {
                 errname = u_errorName(err);
                 fprintf(stderr, "test_widestrs: ucnv_wcstombs error: %s!\n",errname);
index 8e29d4c6815800352afa4ef82a8b186324ca6128..ca34e0938455831ccaf3ca1582d9dcf93bc69c44 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1999-2006, International Business Machines Corporation and
+ * Copyright (c) 1999-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 #include "unicode/utypes.h"
@@ -163,6 +163,7 @@ UBool isEuroAware(UConverter* myConv)
             target,
             targetSize,
             &err);
+    (void)euroBackSize;    /* Suppress set but not used warning. */
     if (U_FAILURE(err))
     {
         log_err("Failure Occured in ucnv_toUChars euro roundtrip test\n");
index 5f5f38ec38a8585750930c69fc56904aa0d7f529..f459bf4ef91a3e16353e9b98eb84a3ce78c68332 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *******************************************************************************
  *
- *   Copyright (C) 2003-2010, International Business Machines
+ *   Copyright (C) 2003-2013, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  *
  *******************************************************************************
@@ -830,6 +830,7 @@ static void TestJB5273(){
     UErrorCode status = U_ZERO_ERROR;
     UParseError prsError;
     int32_t outLen = uidna_toUnicode(invalid_idn, len, output, 50, UIDNA_DEFAULT, &prsError, &status);
+    (void)outLen;    /* Suppress set but not used warning. */
     if(U_FAILURE(status)){
         log_err_status(status, "uidna_toUnicode failed with error: %s\n", u_errorName(status));
     }
index 5b4c528389af2dc3829079097f95778b2f7add91..ee18abfb9664c2e8a4e821ae300c29f1dfef2dd2 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 2004-2012, International Business Machines Corporation and
+ * Copyright (c) 2004-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /********************************************************************************
@@ -1619,6 +1619,7 @@ static void TestUTextAPI(void) {
         utext_close(resultText);
         
         result = uregex_getText(re, &textLength, &status); /* flattens UText into buffer */
+        (void)result;    /* Suppress set but not used warning. */
         TEST_ASSERT(textLength == -1 || textLength == 6);
         resultText = uregex_getUText(re, NULL, &status);
         TEST_ASSERT_SUCCESS(status);
index d61804482a1c2b982c9f69b91c13026cd9d0f46e..b22ba596efa030207203c7f098f677728adbae42 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 2003-2007, International Business Machines Corporation and
+ * Copyright (c) 2003-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /*
@@ -92,6 +92,7 @@ static void test_format(const char *format, int32_t bufCap, int32_t indent,
     va_start(args, line);
     memset(buf, 0, sizeof(buf));
     len = utrace_vformat(buf, bufCap, indent, format, args);
+    (void)len;    /* Suppress set but not used warning. */
 
     /* Check results.   */
     if (strcmp(expectedResult, buf) != 0) {
index 290fc388f7ebec24cf75cf671d98c16a67dc6b38..bc715134fba040aba747acab36a2dd623a9b65ae 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 2005-2011, International Business Machines Corporation and
+ * Copyright (c) 2005-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /*
@@ -58,6 +58,7 @@ addUTextTest(TestNode** root)
 static void TestAPI(void) {
     UErrorCode      status = U_ZERO_ERROR;
     UBool           gFailed = FALSE;
+    (void)gFailed;   /* Suppress set but not used warning. */
 
     /* Open    */
     {
index bc9f614fb07a0ba29e1ef2f3a1b6072385dc0cb7..9213077f8fa30026c811d572e1b25770885eb790 100644 (file)
@@ -1,6 +1,6 @@
 /*
  ****************************************************************************
- * Copyright (c) 1997-2010, International Business Machines Corporation and *
+ * Copyright (c) 1997-2013, International Business Machines Corporation and *
  * others. All Rights Reserved.                                             *
  ****************************************************************************
  */
@@ -198,6 +198,7 @@ static void TestFromInt64(void)
     UErrorCode status = U_ZERO_ERROR;
 
     result = utmscale_fromInt64(0, -1, &status);
+    (void)result;    /* Suppress set but not used warning. */
     if (status != U_ILLEGAL_ARGUMENT_ERROR) {
         log_err("utmscale_fromInt64(0, -1, status) did not set status to U_ILLEGAL_ARGUMENT_ERROR.\n");
     }
@@ -258,6 +259,7 @@ static void TestToInt64(void)
     UErrorCode status = U_ZERO_ERROR;
 
     result = utmscale_toInt64(0, -1, &status);
+    (void)result;    /* suppress set but not used warning. */
     if (status != U_ILLEGAL_ARGUMENT_ERROR) {
         log_err("utmscale_toInt64(0, -1, &status) did not generate U_ILLEGAL_ARGUMENT_ERROR.\n");
     }
index 36564b1228c19ad0415eeb617c6a4df739e18465..9a25c265187215b38ffb09da747c2c73907505f2 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2012, International Business Machines Corporation
+ * Copyright (c) 1997-2013, International Business Machines Corporation
  * and others. All Rights Reserved.
  ********************************************************************/
  
@@ -326,6 +326,7 @@ void CalendarRegressionTest::test4040996()
     }
     UErrorCode status = U_ZERO_ERROR;    
     count = ids->count(status);
+    (void)count;    // Suppress set but not used warning.
     SimpleTimeZone *pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, *ids->snext(status));
     pdt->setStartRule(UCAL_APRIL, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status);
     pdt->setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status);
index 89788b5cb5697e579dd7ac7042f4b46819a7c385..e36cf7b2709ecd7de8eafbce00268507e1435486 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (c) 2002-2012, International Business Machines Corporation and
+ * Copyright (c) 2002-2013, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 
@@ -415,7 +415,7 @@ void DecimalFormatTest::execFormatTest(int32_t lineNum,
                 lineNum, UnicodeStringPiece(round).data());
     }
 
-    const char *typeStr;
+    const char *typeStr = "Unknown";
     UnicodeString result;
     UnicodeStringPiece spInput(input);
 
index fc104eb548589e470f7faefd57f82a60cf6eb2da..1a1a8e48c78102d3fadc6916ed74b3561dbcf05a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  **********************************************************************
- *   Copyright (C) 2004-2011, International Business Machines
+ *   Copyright (C) 2004-2013, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  **********************************************************************
  *   file name:  filetst.c
@@ -981,6 +981,7 @@ static void TestFilePrintCompatibility(void) {
     static const UChar emptyStr[] = {0};
     char readBuf[512] = "";
     char testBuf[512] = "";
+    int32_t n = 0;
 
     if (myFile == NULL) {
         log_err("Can't write test file.\n");
@@ -1021,38 +1022,39 @@ static void TestFilePrintCompatibility(void) {
     }
 
     for (num = -STANDARD_TEST_NUM_RANGE; num < STANDARD_TEST_NUM_RANGE; num++) {
-        fscanf(myCFile, "%s", readBuf);
+        /* Note: gcc on Ubuntu complains if return value of scanf is ignored. */
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%x", (int)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%x Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
         }
 
-        fscanf(myCFile, "%s", readBuf);
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%X", (int)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%X Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
         }
 
-        fscanf(myCFile, "%s", readBuf);
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%o", (int)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%o Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
         }
 
         /* fprintf is not compatible on all platforms e.g. the iSeries */
-        fscanf(myCFile, "%s", readBuf);
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%d", (int)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%d Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
         }
 
-        fscanf(myCFile, "%s", readBuf);
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%i", (int)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%i Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
         }
 
-        fscanf(myCFile, "%s", readBuf);
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%f", (double)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%f Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
@@ -1070,13 +1072,13 @@ static void TestFilePrintCompatibility(void) {
             log_err("%%E Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
         }*/
 
-        fscanf(myCFile, "%s", readBuf);
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%g", (double)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%g Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
         }
 
-        fscanf(myCFile, "%s", readBuf);
+        n += fscanf(myCFile, "%s", readBuf);
         sprintf(testBuf, "%G", (double)num);
         if (strcmp(readBuf, testBuf) != 0) {
             log_err("%%G Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
@@ -1085,13 +1087,13 @@ static void TestFilePrintCompatibility(void) {
 
     /* Properly eat the newlines */
     for (num = 0; num < (int32_t)strlen(C_NEW_LINE); num++) {
-        fscanf(myCFile, "%c", &cVal);
+        n += fscanf(myCFile, "%c", &cVal);
         if (cVal != C_NEW_LINE[num]) {
             log_err("OS newline error\n");
         }
     }
     for (num = 0; num < (int32_t)strlen(C_NEW_LINE); num++) {
-        fscanf(myCFile, "%c", &cVal);
+        n += fscanf(myCFile, "%c", &cVal);
         if (cVal != C_NEW_LINE[num]) {
             log_err("ustdio newline error\n");
         }
@@ -1099,11 +1101,12 @@ static void TestFilePrintCompatibility(void) {
 
     for (num = 0; num < 0x80; num++) {
         cVal = -1;
-        fscanf(myCFile, "%c", &cVal);
+        n += fscanf(myCFile, "%c", &cVal);
         if (num != cVal) {
             log_err("%%c Got: 0x%x, Expected: 0x%x\n", cVal, num);
         }
     }
+    (void)n;
     fclose(myCFile);
 }
 #endif
@@ -1416,6 +1419,7 @@ static void Test_u_vfprintf(const char *expectedResult, const char *format, ...)
 
     va_start(ap, format);
     count = u_vfprintf(myFile, format, ap);
+    (void)count;    /* Suppress set but not used warning.  */
     va_end(ap);
 
     u_fclose(myFile);
index 6e79261f904ee0950ec0d63c5081f793f5c492b9..bd9afbcecbc29d82b56ec45f6ae9573c1344d5ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ********************************************************************************
 *
-*   Copyright (C) 1996-2012, International Business Machines
+*   Copyright (C) 1996-2013, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ********************************************************************************
@@ -1243,10 +1243,10 @@ ctest_xml_fini(void) {
 
 int32_t
 T_CTEST_EXPORT2
-ctest_xml_testcase(const char *classname, const char *name, const char *time, const char *failMsg) {
+ctest_xml_testcase(const char *classname, const char *name, const char *timeSeconds, const char *failMsg) {
   if(!XML_FILE) return 0;
 
-  fprintf(XML_FILE, "\t<testcase classname=\"%s:%s\" name=\"%s:%s\" time=\"%s\"", XML_PREFIX, classname, XML_PREFIX, name, time);
+  fprintf(XML_FILE, "\t<testcase classname=\"%s:%s\" name=\"%s:%s\" time=\"%s\"", XML_PREFIX, classname, XML_PREFIX, name, timeSeconds);
   if(failMsg) {
     fprintf(XML_FILE, ">\n\t\t<failure type=\"err\" message=\"%s\"/>\n\t</testcase>\n", failMsg);
   } else {
index a6ed246825726552063d302167cde5d747fe4248..e470332ca6cde27e6e10489dd90b7f9f8fc2b926 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1999-2012, International Business Machines
+*   Copyright (C) 1999-2013, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -1236,7 +1236,8 @@ void Package::setItemCapacity(int32_t max)
   Item *newItems = (Item*)uprv_malloc(max * sizeof(items[0]));
   Item *oldItems = items;
   if(newItems == NULL) {
-    fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n", max*sizeof(items[0]), max);
+    fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n", 
+        (unsigned long)max*sizeof(items[0]), max);
     exit(U_MEMORY_ALLOCATION_ERROR);
   }
   if(items && itemCount>0) {