Clean up localedata tests printf formats, don't use -Wno-format.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 11 Dec 2014 21:15:08 +0000 (13:15 -0800)
committerRoland McGrath <roland@hack.frob.com>
Thu, 11 Dec 2014 21:15:08 +0000 (13:15 -0800)
ChangeLog
localedata/Makefile
localedata/tst-mbswcs1.c
localedata/tst-mbswcs2.c
localedata/tst-mbswcs3.c
localedata/tst-mbswcs4.c
localedata/tst-mbswcs5.c
localedata/tst-trans.c

index 59d95d1..d6386e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2014-12-11  Joseph Myers  <joseph@codesourcery.com>
+
+       * tst-mbswcs1.c (show): Use %zu format instead of %Zd.  Cast
+       corresponding format argument to size_t.
+       * tst-mbswcs2.c (show): Likewise.  Use %td format for ptrdiff_t
+       arguments.
+       * tst-mbswcs3.c (show): Use %zu format instead of %Zd.  Cast
+       corresponding format argument to size_t.
+       * tst-mbswcs4.c (show): Likewise.  Use %td format for ptrdiff_t
+       arguments.
+       * tst-mbswcs5.c (show): Use %zu format instead of %Zd.  Cast
+       corresponding format argument to size_t.
+       * tst-trans.c (do_test): Use %lc format for wint_t arguments.
+       * Makefile (CFLAGS-tst-mbswcs1.c): Remove variable.
+       (CFLAGS-tst-mbswcs2.c): Likewise.
+       (CFLAGS-tst-mbswcs3.c): Likewise.
+       (CFLAGS-tst-mbswcs4.c): Likewise.
+       (CFLAGS-tst-mbswcs5.c): Likewise.
+       (CFLAGS-tst-trans.c): Likewise
+
 2014-12-11  Roland McGrath  <roland@hack.frob.com>
 
        * posix/regexbug1.c (main): Use "%s" format with regerror results,
index c2c62a2..0826b36 100644 (file)
@@ -126,14 +126,6 @@ $(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
 # Install the locale source files in the appropriate directory.
 $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
 
-# gcc does not know all the format specifiers we are using here.
-CFLAGS-tst-mbswcs1.c = -Wno-format
-CFLAGS-tst-mbswcs2.c = -Wno-format
-CFLAGS-tst-mbswcs3.c = -Wno-format
-CFLAGS-tst-mbswcs4.c = -Wno-format
-CFLAGS-tst-mbswcs5.c = -Wno-format
-CFLAGS-tst-trans.c = -Wno-format
-
 
 ifeq ($(run-built-tests),yes)
 generated-dirs += $(LOCALES)
index 1404829..15691db 100644 (file)
 
 #define show(expr, nexp, wcexp) \
   n = expr;                                                              \
-  printf (#expr " -> %Zd", n);                                           \
+  printf (#expr " -> %zu", n);                                           \
   printf (", wc = %lu", (unsigned long int) wc);                         \
   if (n != (size_t) nexp || wc != wcexp)                                 \
     {                                                                    \
-      printf (", expected %Zd and %lu", nexp, (unsigned long int) wcexp); \
+      printf (", expected %zu and %lu", (size_t) nexp,                   \
+             (unsigned long int) wcexp);                                 \
       result = 1;                                                        \
     }                                                                    \
   putc ('\n', stdout)
index 9cd95d6..d0f502c 100644 (file)
 
 #define show(expr, nexp, wcexp, end) \
   n = expr;                                                            \
-  printf (#expr " -> %Zd", n);                                         \
-  printf (", wc = %lu, src = buf+%d", (unsigned long int) wc,          \
+  printf (#expr " -> %zu", n);                                         \
+  printf (", wc = %lu, src = buf+%td", (unsigned long int) wc,         \
          src - (const char *) buf);                                    \
   if (n != (size_t) nexp || wc != wcexp || src != (const char *) (end))        \
     {                                                                  \
-      printf (", expected %Zd and %lu and buf+%d", nexp,               \
+      printf (", expected %zu and %lu and buf+%td", (size_t) nexp,     \
              (unsigned long int) wcexp, (end) - buf);                  \
       result = 1;                                                      \
     }                                                                  \
index a068541..ef18a98 100644 (file)
 #define show(expr, nexp, srcexp, bufexp) \
   {                                                                    \
     size_t res = expr;                                                 \
-    printf (#expr " -> %Zd", res);                                     \
+    printf (#expr " -> %zu", res);                                     \
     dst += res;                                                                \
     printf (", src = srcbuf+%td, dst = buf+%td",                       \
            src - srcbuf, dst - (char *) buf);                          \
     if (res != nexp || src != (srcexp) || dst != (char *) (bufexp))    \
       {                                                                        \
-       printf (", expected %Zd and srcbuf+%td and buf+%td", nexp,      \
+       printf (", expected %zu and srcbuf+%td and buf+%td", (size_t) nexp, \
                (srcexp) - srcbuf, (bufexp) - (unsigned char *) buf);   \
        result = 1;                                                     \
       }                                                                        \
index a4fe60d..83c5eac 100644 (file)
 
 #define show(expr, nexp, wcexp, end) \
   n = expr;                                                            \
-  printf (#expr " -> %Zd", n);                                         \
-  printf (", wc = %lu, src = buf+%d", (unsigned long int) wc,          \
+  printf (#expr " -> %zu", n);                                         \
+  printf (", wc = %lu, src = buf+%td", (unsigned long int) wc,         \
          src - (const char *) buf);                                    \
   if (n != (size_t) nexp || wc != wcexp || src != (const char *) (end))        \
     {                                                                  \
-      printf (", expected %Zd and %lu and buf+%d", nexp,               \
+      printf (", expected %zu and %lu and buf+%td", (size_t) nexp,     \
              (unsigned long int) wcexp, (end) - buf);                  \
       result = 1;                                                      \
     }                                                                  \
index c44f12a..1ff56f3 100644 (file)
 #define show(expr, nexp, bufexp) \
   {                                                                    \
     size_t res = expr;                                                 \
-    printf (#expr " -> %Zd", res);                                     \
+    printf (#expr " -> %zu", res);                                     \
     dst += res;                                                                \
     printf (", dst = buf+%td", dst - (char *) buf);                    \
     if (res != nexp || dst != (char *) (bufexp))                       \
       {                                                                        \
-       printf (", expected %Zd and buf+%td", nexp,                     \
+       printf (", expected %zu and buf+%td", (size_t) nexp,            \
                (bufexp) - (unsigned char *) buf);                      \
        result = 1;                                                     \
       }                                                                        \
index 0b0be83..616c896 100644 (file)
@@ -44,12 +44,12 @@ do_test (void)
     }
 
   wch = towctrans (L'A', t);
-  printf ("towctrans (L'A', t) = %c\n", wch);
+  printf ("towctrans (L'A', t) = %lc\n", wch);
   if (wch != L'B')
     errors = 1;
 
   wch = towctrans (L'B', t);
-  printf ("towctrans (L'B', t) = %c\n", wch);
+  printf ("towctrans (L'B', t) = %lc\n", wch);
   if (wch != L'C')
     errors = 1;