-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 02/28/2014 04:24 PM, Nicholas Nethercote wrote:
> On Sat, Mar 1, 2014 at 3:26 AM, Zack Weinberg <za...@panix.com>
> wrote:
>> 
>> Then, when you get a false-positive maybe-uninitialized warning,
>> you could just replace T var; with mfbt::ConditionalUse<T> var;
>> In a release build, there would be no overhead; in a debug or
>> valgrind build you would get a prompt assertion on an invalid
>> use.  For particularly dangerous-to-use-uninitialized types (e.g.
>> pointers) the release build could specialize the template to
>> initialize the value to a poison pattern.
> 
> Interesting! But won't you still get warnings in opt builds?

Yeah, I guess you would.  We could maybe just live with that - at
least, what *I* personally care about is not having to wade through a
flood of preexisting "maybe used uninitialized" warnings to find any
new warnings due to what I just changed, and I basically never do opt
builds locally.

There might also be compiler-specific ways to annotate the variable so
it doesn't trigger warnings even in release builds; I'd be more
comfortable doing that if it were coupled with automatic debug
assertions.  Or we could initialize it all the time; perhaps the
people who don't like that idea would be more comfortable with it
coupled with automatic debug assertions ;-)

zw
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBCAAGBQJTEQUCAAoJEJH8wytnaapkkZsP/RughC9LVDJkGWLc6dsjFL9z
6c8UULdHGJn/mtm61z5a572MX+x7g323zb6zPI64u2ybJyUnUVsB4gpU8yIXZoTD
fOLawYS7GOXoAmowOfs74pbtFfKU3eHzBk3KkEtLKMq2RV4fdbqlav3hYS5Dlgyk
0rsx+fnVLTtGV8kK/fK8rKPEtIdpJDx+aLDc6LJ9kc2IiJbsvGTpPUUKScEnBy00
buZfCTOnBtXnDktsOhRiaQ5tRpdgyFhW8JhhcWIHtRpKrggD+U0yb4Z1CZuCsQmU
DlZHbT5Udo2DGafBFmdUk9kyTysydo0EJ95ysV+cHTQkI6VkCghyEC5mKdRI4/ok
lvpvVKitiT+sxC2aMU+GTvu4H+prV7xIiC/DYNvM5zQ1hDwB8Kn7h+UrJjl/hinP
OJVSXwNR96JY/jg5ckdnw8vCIxyWjCmBhtWeYs+Pv4fBbIkYGUguffCEeuyWtGrY
2rBHZOmYwOMBM45LuJm9VtK79/Q0Ynv7h+sd8hhsO1IoVxhPfifQ/mHqZAZSRA3k
Pnw05HrUN1A2qKlTnPWQ+ZnbQPyBeZYZ9XAHAf9zVIu8AN//02IookMXMwVj4Qkn
0A7+fTV72VlQqi0AbzrsUgmciMXs/wByokRkkrFVeXTe0ScC/qpX4zt/b2pz41U0
0LJ9bqK8OJsVPuDxNDWw
=ywpM
-----END PGP SIGNATURE-----
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to