From f65607751cf60bb615ee0437a0d0984af47b0fb3 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 16 May 2007 19:31:08 +0000 Subject: * libc/stdlib/wctomb_r.c (_wctomb_r): Avoid gcc warnings on cygwin. * libc/search/hash.c (__hash_open): Likewise. --- newlib/libc/stdlib/wctomb_r.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'newlib/libc/stdlib/wctomb_r.c') diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index a01863246..82730424f 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -13,9 +13,14 @@ int _DEFUN (_wctomb_r, (r, s, wchar, state), struct _reent *r _AND char *s _AND - wchar_t wchar _AND + wchar_t _wchar _AND mbstate_t *state) { + /* Avoids compiler warnings about comparisons that are always false + due to limited range when sizeof(wchar_t) is 2 but sizeof(wint_t) + is 4, as is the case on cygwin. */ + wint_t wchar = _wchar; + if (strlen (__lc_ctype) <= 1) { /* fall-through */ } else if (!strcmp (__lc_ctype, "C-UTF-8")) @@ -171,4 +176,3 @@ _DEFUN (_wctomb_r, (r, s, wchar, state), return 1; } - -- cgit v1.2.3