This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [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: Julius Plenz <julius at plenz dot com>, Andreas Schwab <schwab at suse dot de>, libc-alpha at sourceware dot org
- Date: Tue, 14 May 2013 09:55:18 -0400
- Subject: Re: [PATCH] [BZ #15381] Initialize wide struct info.
- References: <20130514115913 dot GF20282 at plenz dot com>
On 05/14/2013 07:59 AM, Julius Plenz wrote:
> Hi,
>
> * Andreas Schwab <schwab@suse.de>:
>>> Are you opposed to initializing _wide_data to NULL?
>>
>> I would prefer -1 so that broken uses crash predictably. :-)
>
> Since undefined behaviour can be anything you like, both initializing
> with NULL and with -1 is equally "valid".
>
> However I agree with Andreas that initializing with -1 would expose
> the user's bug reliably (as it did in the case of mutt), whereas NULL
> would hide this, possibly leading to confusion.
I'm happy with -1.
I don't care what value it takes, so long as we fix the invalid use
with a predictable crash, assert, or returned error code.
Ondrej,
Comments?
Cheers,
Carlos.