[PATCH] [BZ #15381] Initialize wide struct info.

Carlos O'Donell carlos@redhat.com
Tue May 14 13:56:00 GMT 2013


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.



More information about the Libc-alpha mailing list