This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] [BZ #15381] Initialize wide struct info.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, Julius Plenz <julius at plenz dot com>, Andreas Schwab <schwab at suse dot de>, libc-alpha at sourceware dot org
- Date: Wed, 22 May 2013 14:44:08 -0400
- Subject: Re: [PATCH v2] [BZ #15381] Initialize wide struct info.
- References: <mvmmwryyq0g dot fsf at hawking dot suse dot de> <20130514115913 dot GF20282 at plenz dot com> <20130514123120 dot GA18821 at domone dot kolej dot mff dot cuni dot cz> <8761yinhb9 dot fsf at hase dot home> <20130522092752 dot GA7079 at domone dot kolej dot mff dot cuni dot cz>
On 05/22/2013 05:27 AM, OndÅej BÃlka wrote:
> On Fri, May 17, 2013 at 10:26:02AM +0200, Andreas Schwab wrote:
>> OndÅej BÃlka <neleai@seznam.cz> writes:
>>
>>> @@ -643,6 +643,7 @@ _IO_no_init (fp, flags, orientation, wd, jmp)
>>> {
>>> _IO_old_init (fp, flags);
>>> fp->_mode = orientation;
>>> + fp->_wide_data = (void *) -1;
>>> #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
>>
>> _wide_data is only availble inside this conditional.
>>
> Thanks, adjusted.
>
> * libio/genops.c (_IO_no_init): Initialize wide struct info.
>
> ---
> libio/genops.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/libio/genops.c b/libio/genops.c
> index 390d8d2..dc7da15 100644
> --- a/libio/genops.c
> +++ b/libio/genops.c
> @@ -661,6 +661,10 @@ _IO_no_init (fp, flags, orientation, wd, jmp)
>
> fp->_wide_data->_wide_vtable = jmp;
> }
> + else
> + /* Cause predicable crash when wide function is called on byte
> + stream. */
> + fp->_wide_data = (struct _IO_wide_data *) -1;
> #endif
> fp->_freeres_list = NULL;
> }
>
OK after you reply to Richard's comments, and ensure that -1L
is not required to avoid warnings (per Roland's comment).
Cheers,
Carlos.