Merge from trunk rev. 4530: 2011-10-08 Kai Tietz <ktietz@redhat.com> * misc/wcrtomb.c: Fix an inlining bug occuring with newer gcc. This can go away if bug on gcc side is fixed. git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/stable/v2.x@4534 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-crt/ChangeLog b/mingw-w64-crt/ChangeLog index 58cce30..50df87f 100644 --- a/mingw-w64-crt/ChangeLog +++ b/mingw-w64-crt/ChangeLog
@@ -1,3 +1,10 @@ +2011-10-09 Ozkan Sezer <sezeroz@gmail.com> + + Merge from trunk rev. 4530: + 2011-10-08 Kai Tietz <ktietz@redhat.com> + * misc/wcrtomb.c: Fix an inlining bug occuring with newer gcc. + This can go away if bug on gcc side is fixed. + 2011-10-09 Ruben Van Boxem <vanboxem.ruben@gmail.com> * misc/isblank.c: Replaced _cdecl by __cdecl.
diff --git a/mingw-w64-crt/misc/wcrtomb.c b/mingw-w64-crt/misc/wcrtomb.c index 5e0cb6a..385c2dc 100644 --- a/mingw-w64-crt/misc/wcrtomb.c +++ b/mingw-w64-crt/misc/wcrtomb.c
@@ -13,7 +13,7 @@ #include <limits.h> #include <windows.h> - +__attribute__((noinline)) static int __MINGW_ATTRIB_NONNULL(1) __wcrtomb_cp (char *dst, wchar_t wc, const unsigned int cp, const unsigned int mb_max) @@ -48,7 +48,7 @@ wcrtomb (char *dst, wchar_t wc, mbstate_t * __UNUSED_PARAM (ps)) { char byte_bucket [MB_LEN_MAX]; - char* tmp_dst = dst ? dst : byte_bucket; + char* tmp_dst = dst ? dst : &byte_bucket[0]; return (size_t)__wcrtomb_cp (tmp_dst, wc, __mingw_get_codepage (), MB_CUR_MAX); } @@ -87,7 +87,7 @@ char byte_bucket [MB_LEN_MAX]; while (n < len) { - if ((ret = __wcrtomb_cp (byte_bucket, *pwc, cp, mb_max)) <= 0) + if ((ret = __wcrtomb_cp (&byte_bucket[0], *pwc, cp, mb_max)) <= 0) return (size_t) -1; n += ret; if (byte_bucket [ret - 1] == '\0')