Re: Maybe-uninitialized warning helper template

2014-02-28 Thread Zack Weinberg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 02/28/2014 06:04 PM, Botond Ballo wrote: >>> Is there a way to make the template generate 'T var = var;' in >>> the release case when there's no initializer? That's be a >>> useful hack to silence -Wunused-variable, >>> -Wsometimes-uninitialized,

Re: Maybe-uninitialized warning helper template

2014-02-28 Thread Botond Ballo
> > Is there a way to make the template generate 'T var = var;' in the > > release case when there's no initializer? That's be a useful hack > > to silence -Wunused-variable, -Wsometimes-uninitialized, etc. on > > gcc and clang. > > I'm not aware of any way to do that, but I am certainly not the >

Re: Maybe-uninitialized warning helper template

2014-02-28 Thread Zack Weinberg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 02/28/2014 05:19 PM, Ralph Giles wrote: > On 2014-02-28 1:52 PM, Zack Weinberg wrote: > >> 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 pree

Re: Maybe-uninitialized warning helper template

2014-02-28 Thread Ralph Giles
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-02-28 1:52 PM, Zack Weinberg wrote: > 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

Re: Maybe-uninitialized warning helper template

2014-02-28 Thread Zack Weinberg
-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 > wrote: >> >> Then, when you get a false-positive maybe-uninitialized warning, >> you could just replace T var; with mfbt::ConditionalUse var; >> In

Re: Maybe-uninitialized warning helper template

2014-02-28 Thread Nicholas Nethercote
On Sat, Mar 1, 2014 at 3:26 AM, Zack Weinberg wrote: > > Then, when you get a false-positive maybe-uninitialized warning, you > could just replace T var; with mfbt::ConditionalUse var; In a > release build, there would be no overhead; in a debug or valgrind > build you would get a prompt assertio