[PATCH] [BZ #15381] Initialize wide struct info.
Rich Felker
dalias@aerifal.cx
Tue May 14 14:13:00 GMT 2013
On Tue, May 14, 2013 at 02:31:20PM +0200, OndÅej BÃlka wrote:
> On Tue, May 14, 2013 at 01:59:13PM +0200, 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".
> >
> OK, here is version with -1 (or 0xdeadbeef if you like it more)
-1 will reliably crash on any real-world target. 0xdeadbeef is likely
only to crash on small processes or machines that enforce alignment,
and would otherwise potentially corrupt application memory badly.
Rich
More information about the Libc-alpha
mailing list