From: Pádraig Brady Date: Sat, 26 Nov 2016 15:39:11 +0000 (+0000) Subject: maint: use a more standard return from mbrtowc test X-Git-Tag: v1.0~6528 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=45ba7f22dafd07233d67ccb2d90824a02f9d6dec;p=gnulib.git maint: use a more standard return from mbrtowc test 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. --- diff --git a/ChangeLog b/ChangeLog index a7e03f227f..c27f6191e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2016-11-27 Pádraig Brady + + 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 freopen: work around glibc bug with closed fd diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index d370fccf06..5edf08beb6 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -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; ]])],