This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]