]> Savannah Git Hosting - gnulib.git/commitdiff
maint: use a more standard return from mbrtowc test
authorPádraig Brady <P@draigBrady.com>
Sat, 26 Nov 2016 15:39:11 +0000 (15:39 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 27 Nov 2016 00:20:05 +0000 (00:20 +0000)
With this we can use this check in coreutils to find configure issues:
  grep -E '(program exited with status 1$|core dumped)' config.log

* m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): Don't return 1
from the test program as this often indicates an
unhandled case in the test program.
(gl_MBRTOWC_INCOMPLETE_STATE): Likewise.
(gl_MBRTOWC_SANITYCHECK): Likewise.
(gl_MBRTOWC_NULL_ARG2): Likewise.
(gl_MBRTOWC_NUL_RETVAL): Likewise.

ChangeLog
m4/mbrtowc.m4

index a7e03f227f8e9de32fec79c07648391e9f4e02bf..c27f6191e5a50cbb37e07b62d26c3e07893ea9e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2016-11-27  Pádraig Brady  <P@draigBrady.com>
+
+       maint: use a more standard return from mbrtowc test
+       * m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): Don't return 1
+       from the test program as this often indicates an
+       unhandled case in the test program.
+       (gl_MBRTOWC_INCOMPLETE_STATE): Likewise.
+       (gl_MBRTOWC_SANITYCHECK): Likewise.
+       (gl_MBRTOWC_NULL_ARG2): Likewise.
+       (gl_MBRTOWC_NUL_RETVAL): Likewise.
+
 2016-11-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        freopen: work around glibc bug with closed fd
index d370fccf06d423058682bf2f1dc760093d3a3e43..5edf08beb6d79b60d5a4fa17559f5dec1e41e46c 100644 (file)
@@ -164,7 +164,7 @@ int main ()
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
         if (mbsinit (&state))
-          return 1;
+          return 2;
     }
   return 0;
 }]])],
@@ -224,7 +224,7 @@ int main ()
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, input + 3, 6, &state) != 4
           && mbtowc (&wc, input + 3, 6) == 4)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -352,7 +352,7 @@ int main ()
       mbrtowc (&wc, NULL, 5, &state);
       /* Check that wc was not modified.  */
       if (wc != (wchar_t) 0xBADFACE)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -539,7 +539,7 @@ int main ()
 
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, "", 1, &state) != 0)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -608,7 +608,7 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
             int i;
             char *locale = setlocale (LC_ALL, "C");
             if (! locale)
-              return 1;
+              return 2;
             for (i = CHAR_MIN; i <= CHAR_MAX; i++)
               {
                 char c = i;
@@ -616,7 +616,7 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
                 mbstate_t mbs = { 0, };
                 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
                 if (1 < ss)
-                  return 1;
+                  return 3;
               }
             return 0;
           ]])],