]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
format-c: Recognize size specifiers w8, w16, w32, w64, wf8, wf16, wf32, wf64.
authorBruno Haible <bruno@clisp.org>
Sun, 28 May 2023 15:45:08 +0000 (17:45 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 28 May 2023 15:45:08 +0000 (17:45 +0200)
* gettext-tools/src/format-c.c (INVALID_SIZE_SPECIFIER): New macro.
* gettext-tools/src/format-c-parse.h (format_parse_entrails): Accept only one
size specifier, not a sequence of size specifiers. Accept "wN" and "wfN",
where N = 8, 16, 32, 64. Reject integer size specifiers for floating-point
directives. Reject integer size specifiers other than "l" for %c and %s.
* gettext-tools/tests/format-c-1: Add more test cases.
* gettext-tools/tests/format-c-2: Likewise.
* NEWS: Mention it.

NEWS
gettext-tools/src/format-c-parse.h
gettext-tools/src/format-c.c
gettext-tools/tests/format-c-1
gettext-tools/tests/format-c-2

diff --git a/NEWS b/NEWS
index 7a1d08c173693e1c226c08d69d7322e81f27d43a..5ac7ce4b44c6af4038081380e276ade2f78abe02 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,9 @@ Version 0.21.2 - May 2023
       ISO C 23, as tokens.
     o xgettext and msgfmt now recognize the format string directive %b
       (for binary integer output, as defined by ISO C 23) in format strings.
+    o xgettext and msgfmt now recognize the argument size specifiers
+      w8, w16, w32, w64, wf8, wf16, wf32, wf64 (as defined by ISO C 23)
+      in format strings.
   - Tcl: xgettext now supports the \x, \u, and \U escapes as defined in
     Tcl 8.6.
 
index a53e61c49bd0217d0477d6e40f4894ad28a2aea8..2e164222aca5546fc13955abeff1456a6c323dc6 100644 (file)
@@ -203,7 +203,10 @@ format_parse_entrails (const char *format, bool translated,
         /* A directive.  */
         unsigned int number = 0;
         format_arg_type_t type;
-        format_arg_type_t size;
+        /* Relevant for the conversion characters d, i, b, o, u, x, X, n.  */
+        format_arg_type_t integer_size;
+        /* Relevant for the conversion characters a, A, e, E, f, F, g, G.  */
+        format_arg_type_t floatingpoint_size;
 
         FDI_SET (format - 1, FMTDIR_START);
         spec.directives++;
@@ -600,50 +603,127 @@ format_parse_entrails (const char *format, bool translated,
         else
           {
             /* Parse size.  */
-            size = 0;
-            for (;; format++)
+            integer_size = 0;
+            floatingpoint_size = 0;
+
+            if (*format == 'h')
               {
-                if (*format == 'h')
+                if (format[1] == 'h')
                   {
-                    if (size & (FAT_SIZE_SHORT | FAT_SIZE_CHAR))
-                      size = FAT_SIZE_CHAR;
-                    else
-                      size = FAT_SIZE_SHORT;
+                    integer_size = FAT_SIZE_CHAR;
+                    format += 2;
                   }
-                else if (*format == 'l')
+                else
                   {
-                    if (size & (FAT_SIZE_LONG | FAT_SIZE_LONGLONG))
-                      size = FAT_SIZE_LONGLONG;
-                    else
-                      size = FAT_SIZE_LONG;
+                    integer_size = FAT_SIZE_SHORT;
+                    format++;
                   }
-                else if (*format == 'L')
-                  size = FAT_SIZE_LONGLONG;
-                else if (*format == 'q')
-                  /* Old BSD 4.4 convention.  */
-                  size = FAT_SIZE_LONGLONG;
-                else if (*format == 'j')
-                  size = FAT_SIZE_INTMAX_T;
-                else if (*format == 'z' || *format == 'Z')
-                  /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
-                     because the warning facility in gcc-2.95.2 understands
-                     only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784).  */
-                  size = FAT_SIZE_SIZE_T;
-                else if (*format == 't')
-                  size = FAT_SIZE_PTRDIFF_T;
-#if defined _WIN32 && ! defined __CYGWIN__
-                else if (SYSDEP_SEGMENTS_PROCESSED
-                         && *format == 'I'
-                         && format[1] == '6'
-                         && format[2] == '4')
+              }
+            else if (*format == 'l')
+              {
+                if (format[1] == 'l')
                   {
-                    size = FAT_SIZE_64_T;
+                    integer_size = FAT_SIZE_LONGLONG;
+                    /* For backward compatibility only.  */
+                    floatingpoint_size = FAT_SIZE_LONGLONG;
                     format += 2;
                   }
-#endif
                 else
-                  break;
+                  {
+                    integer_size = FAT_SIZE_LONG;
+                    format++;
+                  }
+              }
+            else if (*format == 'L'
+                     /* Old BSD 4.4 convention.  */
+                     || *format == 'q')
+              {
+                integer_size = FAT_SIZE_LONGLONG;
+                floatingpoint_size = FAT_SIZE_LONGLONG;
+                format++;
+              }
+            else if (*format == 'j')
+              {
+                integer_size = FAT_SIZE_INTMAX_T;
+                format++;
+              }
+            else if (*format == 'z' || *format == 'Z')
+              {
+                /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+                   because the warning facility in gcc-2.95.2 understands
+                   only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784).  */
+                integer_size = FAT_SIZE_SIZE_T;
+                format++;
+              }
+            else if (*format == 't')
+              {
+                integer_size = FAT_SIZE_PTRDIFF_T;
+                format++;
+              }
+            else if (*format == 'w')
+              {
+                /* wN and wfN are standardized in ISO C 23.  */
+                if (format[1] == 'f')
+                  {
+                    if (format[2] == '8')
+                      {
+                        integer_size = FAT_SIZE_FAST8_T;
+                        format += 3;
+                      }
+                    else if (format[2] == '1' && format[3] == '6')
+                      {
+                        integer_size = FAT_SIZE_FAST16_T;
+                        format += 4;
+                      }
+                    else if (format[2] == '3' && format[3] == '2')
+                      {
+                        integer_size = FAT_SIZE_FAST32_T;
+                        format += 4;
+                      }
+                    else if (format[2] == '6' && format[3] == '4')
+                      {
+                        integer_size = FAT_SIZE_FAST64_T;
+                        format += 4;
+                      }
+                  }
+                else
+                  {
+                    if (format[1] == '8')
+                      {
+                        integer_size = FAT_SIZE_LEAST8_T;
+                        format += 2;
+                      }
+                    else if (format[1] == '1' && format[2] == '6')
+                      {
+                        integer_size = FAT_SIZE_LEAST16_T;
+                        format += 3;
+                      }
+                    else if (format[1] == '3' && format[2] == '2')
+                      {
+                        integer_size = FAT_SIZE_LEAST32_T;
+                        format += 3;
+                      }
+                    else if (format[1] == '6' && format[2] == '4')
+                      {
+                        integer_size = FAT_SIZE_LEAST64_T;
+                        format += 3;
+                      }
+                  }
+              }
+#if defined _WIN32 && ! defined __CYGWIN__
+            else if (SYSDEP_SEGMENTS_PROCESSED
+                     && *format == 'I'
+                     && format[1] == '6'
+                     && format[2] == '4')
+              {
+                integer_size = FAT_SIZE_64_T;
+                format += 3;
               }
+#endif
+            if (!((integer_size & ~FAT_SIZE_MASK) == 0))
+              abort ();
+            if (!((floatingpoint_size & ~FAT_SIZE_LONGLONG) == 0))
+              abort ();
 
             switch (*format)
               {
@@ -660,32 +740,51 @@ format_parse_entrails (const char *format, bool translated,
                 break;
               case 'c':
                 type = FAT_CHAR;
-                type |= (size & (FAT_SIZE_LONG | FAT_SIZE_LONGLONG)
-                         ? FAT_WIDE : 0);
+                if (integer_size != 0)
+                  {
+                    if (integer_size != FAT_SIZE_LONG)
+                      {
+                        *invalid_reason = INVALID_SIZE_SPECIFIER (spec.directives);
+                        FDI_SET (format, FMTDIR_ERROR);
+                        goto bad_format;
+                      }
+                    type |= FAT_WIDE;
+                  }
                 break;
               case 'C': /* obsolete */
                 type = FAT_CHAR | FAT_WIDE;
                 break;
               case 's':
                 type = FAT_STRING;
-                type |= (size & (FAT_SIZE_LONG | FAT_SIZE_LONGLONG)
-                         ? FAT_WIDE : 0);
+                if (integer_size != 0)
+                  {
+                    if (integer_size != FAT_SIZE_LONG)
+                      {
+                        *invalid_reason = INVALID_SIZE_SPECIFIER (spec.directives);
+                        FDI_SET (format, FMTDIR_ERROR);
+                        goto bad_format;
+                      }
+                    type |= FAT_WIDE;
+                  }
                 break;
               case 'S': /* obsolete */
                 type = FAT_STRING | FAT_WIDE;
                 break;
               case 'i': case 'd':
-                type = FAT_INTEGER;
-                type |= (size & FAT_SIZE_MASK);
+                type = FAT_INTEGER | integer_size;
                 break;
               case 'u': case 'o': case 'x': case 'X': case 'b':
-                type = FAT_INTEGER | FAT_UNSIGNED;
-                type |= (size & FAT_SIZE_MASK);
+                type = FAT_INTEGER | FAT_UNSIGNED | integer_size;
                 break;
               case 'e': case 'E': case 'f': case 'F': case 'g': case 'G':
               case 'a': case 'A':
-                type = FAT_DOUBLE;
-                type |= (size & FAT_SIZE_LONGLONG);
+                if (integer_size != 0 && floatingpoint_size == 0)
+                  {
+                    *invalid_reason = INVALID_SIZE_SPECIFIER (spec.directives);
+                    FDI_SET (format, FMTDIR_ERROR);
+                    goto bad_format;
+                  }
+                type = FAT_DOUBLE | floatingpoint_size;
                 break;
               case '@':
                 if (objc_extensions)
@@ -698,8 +797,7 @@ format_parse_entrails (const char *format, bool translated,
                 type = FAT_POINTER;
                 break;
               case 'n':
-                type = FAT_COUNT_POINTER;
-                type |= (size & FAT_SIZE_MASK);
+                type = FAT_COUNT_POINTER | integer_size;
                 break;
               other:
               default:
index af4e432171ad522410a1c0981266488feee073c9..aabddf08917f62332336be3c4211f3ff5b62e417 100644 (file)
@@ -1,5 +1,5 @@
 /* C format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2019, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -38,6 +38,9 @@
 #define INVALID_ANGLE_BRACKET(directive_number) \
   xasprintf (_("In the directive number %u, the token after '<' is not followed by '>'."), directive_number)
 
+#define INVALID_SIZE_SPECIFIER(directive_number) \
+  xasprintf (_("In the directive number %u, the argument size specifier is invalid."), directive_number)
+
 #define INVALID_IGNORED_ARGUMENT(referenced_arg, ignored_arg) \
   xasprintf (_("The string refers to argument number %u but ignores argument number %u."), referenced_arg, ignored_arg)
 
index 677c4b5c3d9d45fe9233535a9f52215d99fbfe44..b1179992028b61217201e0fb1a44b7fe057254a7 100755 (executable)
@@ -78,6 +78,100 @@ cat <<\EOF > f-c-1.data
 "abc%zi"
 # Valid: one argument with size specifier
 "abc%ti"
+# Valid: one argument with size specifier
+"abc%w8i"
+# Valid: one argument with size specifier
+"abc%w16i"
+# Valid: one argument with size specifier
+"abc%w32i"
+# Valid: one argument with size specifier
+"abc%w64i"
+# Valid: one argument with size specifier
+"abc%wf8i"
+# Valid: one argument with size specifier
+"abc%wf16i"
+# Valid: one argument with size specifier
+"abc%wf32i"
+# Valid: one argument with size specifier
+"abc%wf64i"
+# Invalid: one argument with unsupported size specifier
+"abc%w4i"
+# Invalid: one argument with unsupported size specifier
+"abc%wf4i"
+# Invalid: one floating-point argument with integer size specifier
+"abc%hhg"
+# Invalid: one floating-point argument with integer size specifier
+"abc%hg"
+# Invalid: one floating-point argument with integer size specifier
+"abc%lg"
+# Valid: one floating-point argument with integer size specifier equivalent to 'L'
+"abc%llg"
+# Valid: one floating-point argument with integer size specifier equivalent to 'L'
+"abc%qg"
+# Invalid: one floating-point argument with integer size specifier
+"abc%jg"
+# Invalid: one floating-point argument with integer size specifier
+"abc%zg"
+# Invalid: one floating-point argument with integer size specifier
+"abc%tg"
+# Invalid: one floating-point argument with integer size specifier
+"abc%w8g"
+# Invalid: one floating-point argument with integer size specifier
+"abc%w16g"
+# Invalid: one floating-point argument with integer size specifier
+"abc%w32g"
+# Invalid: one floating-point argument with integer size specifier
+"abc%w64g"
+# Invalid: one floating-point argument with integer size specifier
+"abc%wf8g"
+# Invalid: one floating-point argument with integer size specifier
+"abc%wf16g"
+# Invalid: one floating-point argument with integer size specifier
+"abc%wf32g"
+# Invalid: one floating-point argument with integer size specifier
+"abc%wf64g"
+# Valid: one argument with size specifier
+"abc%lc"
+# Invalid: one character argument with integer size specifier
+"abc%llc"
+# Invalid: one character argument with integer size specifier
+"abc%Lc"
+# Invalid: one character argument with integer size specifier
+"abc%qc"
+# Valid: one argument with size specifier
+"abc%ls"
+# Invalid: one string argument with integer size specifier
+"abc%hhs"
+# Invalid: one string argument with integer size specifier
+"abc%hs"
+# Invalid: one string argument with integer size specifier
+"abc%lls"
+# Invalid: one string argument with integer size specifier
+"abc%Ls"
+# Invalid: one string argument with integer size specifier
+"abc%qs"
+# Invalid: one string argument with integer size specifier
+"abc%js"
+# Invalid: one string argument with integer size specifier
+"abc%zs"
+# Invalid: one string argument with integer size specifier
+"abc%ts"
+# Invalid: one string argument with integer size specifier
+"abc%w8s"
+# Invalid: one string argument with integer size specifier
+"abc%w16s"
+# Invalid: one string argument with integer size specifier
+"abc%w32s"
+# Invalid: one string argument with integer size specifier
+"abc%w64s"
+# Invalid: one string argument with integer size specifier
+"abc%wf8s"
+# Invalid: one string argument with integer size specifier
+"abc%wf16s"
+# Invalid: one string argument with integer size specifier
+"abc%wf32s"
+# Invalid: one string argument with integer size specifier
+"abc%wf64s"
 # Invalid: unterminated
 "abc%"
 # Invalid: unknown format specifier
index 5f7a99c2a0d368acf34bc17aa94c963efbdab87e..11f3095f405f7d5a34cdbf624393b6914480a6ee 100755 (executable)
@@ -43,9 +43,11 @@ msgstr "xyz%2$u"
 # Invalid: added argument
 msgid  "abc%1$udef"
 msgstr "xyz%1$uvw%2$c"
+
 # Valid: type compatibility
 msgid  "abc%i"
 msgstr "xyz%d"
+
 # Valid: type compatibility
 msgid  "abc%o"
 msgstr "xyz%u"
@@ -58,6 +60,7 @@ msgstr "xyz%X"
 # Valid: type compatibility
 msgid  "abc%u"
 msgstr "xyz%b"
+
 # Valid: type compatibility
 msgid  "abc%e"
 msgstr "xyz%E"
@@ -79,6 +82,7 @@ msgstr "xyz%a"
 # Valid: type compatibility
 msgid  "abc%e"
 msgstr "xyz%A"
+
 # Invalid: type incompatibility
 msgid  "abc%c"
 msgstr "xyz%s"
@@ -97,6 +101,7 @@ msgstr "xyz%p"
 # Invalid: type incompatibility
 msgid  "abc%c"
 msgstr "xyz%n"
+
 # Invalid: type incompatibility
 msgid  "abc%s"
 msgstr "xyz%i"
@@ -112,6 +117,7 @@ msgstr "xyz%p"
 # Invalid: type incompatibility
 msgid  "abc%s"
 msgstr "xyz%n"
+
 # Invalid: type incompatibility
 msgid  "abc%i"
 msgstr "xyz%o"
@@ -124,6 +130,7 @@ msgstr "xyz%p"
 # Invalid: type incompatibility
 msgid  "abc%i"
 msgstr "xyz%n"
+
 # Invalid: type incompatibility
 msgid  "abc%u"
 msgstr "xyz%e"
@@ -133,15 +140,18 @@ msgstr "xyz%p"
 # Invalid: type incompatibility
 msgid  "abc%u"
 msgstr "xyz%n"
+
 # Invalid: type incompatibility
 msgid  "abc%e"
 msgstr "xyz%p"
 # Invalid: type incompatibility
 msgid  "abc%e"
 msgstr "xyz%n"
+
 # Invalid: type incompatibility
 msgid  "abc%p"
 msgstr "xyz%n"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%i"
 msgstr "xyz%hhi"
@@ -169,6 +179,31 @@ msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%i"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%i"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%hhi"
 msgstr "xyz%hi"
@@ -193,6 +228,31 @@ msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%hhi"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hhi"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%hi"
 msgstr "xyz%li"
@@ -214,6 +274,31 @@ msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%hi"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%hi"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%li"
 msgstr "xyz%lli"
@@ -232,6 +317,31 @@ msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%li"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%li"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%lli"
 msgstr "xyz%ji"
@@ -241,6 +351,31 @@ msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%lli"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%lli"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%Li"
 msgstr "xyz%ji"
@@ -250,6 +385,31 @@ msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%Li"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%Li"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%qi"
 msgstr "xyz%ji"
@@ -259,15 +419,206 @@ msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%qi"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%qi"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%ji"
 msgstr "xyz%zi"
 # Invalid: type incompatibility due to size
 msgid  "abc%ji"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ji"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility due to size
 msgid  "abc%zi"
 msgstr "xyz%ti"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%zi"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%w8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%ti"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%w8i"
+msgstr "xyz%w16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w8i"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w8i"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w8i"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w8i"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w8i"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w8i"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%w16i"
+msgstr "xyz%w32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w16i"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w16i"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w16i"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w16i"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w16i"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%w32i"
+msgstr "xyz%w64i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w32i"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w32i"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w32i"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w32i"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%w64i"
+msgstr "xyz%wf8i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w64i"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w64i"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%w64i"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%wf8i"
+msgstr "xyz%wf16i"
+# Invalid: type incompatibility due to size
+msgid  "abc%wf8i"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%wf8i"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%wf16i"
+msgstr "xyz%wf32i"
+# Invalid: type incompatibility due to size
+msgid  "abc%wf16i"
+msgstr "xyz%wf64i"
+
+# Invalid: type incompatibility due to size
+msgid  "abc%wf32i"
+msgstr "xyz%wf64i"
+
 # Invalid: type incompatibility for width
 msgid  "abc%g%*g"
 msgstr "xyz%*g%g"
@@ -276,6 +627,9 @@ EOF
 : ${MSGFMT=msgfmt}
 n=0
 while read comment; do
+  if test -z "$comment"; then
+    read comment
+  fi
   read msgid_line
   read msgstr_line
   n=`expr $n + 1`