On Thursday 2014-02-27 15:44 -0500, Zack Weinberg wrote:
> This is exactly the same thing dbaron said the last time I brought
> this up (quite some time ago - 2010, maybe?)  I didn't buy it then and
> I don't buy it now.  I think it is far more likely that a
> maybe-used-uninitialized true positive will *go unnoticed* because
> we've trained ourselves to ignore those warnings, and I don't think
> better precision in a valgrind run is worth the risk of letting a true
> positive slip through in a release build.  Those bugs tend to be
> security critical.

I'm ok with it if you're initializing it to a value that's properly
handled as a reasonable default by the later code.

But if you're initializing it to something that's arbitrary or
useless (like, say, initializing an enumerated type to 0 so that
you'll fall into whichever case that happens to be, whether it
involves assuming a tagged pointer is of a certain type or not), I'm
still against, and I'd rather see the valgrind warning.

But I'm ok with restructuring the code to avoid having either
problem.

> I also defy anyone to demonstrate a measurable performance impact from
> the tiny amount of additional machine code that might be emitted if we
> added initializations to squelch all those warnings.

I'm not at all concerned about performance impact.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to