Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/libm/src/s_exp2.c:346:15: error: 'twopk' may be used uninitialized in this function



On Tue, Nov 01, 2011 at 06:56:24 +0000, Sad Clouds wrote:
> On Mon, 31 Oct 2011 21:58:30 +0100
> Martin Husemann <martin%duskware.de@localhost> wrote:
> 
> > On Mon, Oct 31, 2011 at 08:20:39PM +0000, Sad Clouds wrote:
> > > In function 'exp2': /opt/src/lib/libm/src/s_exp2.c:346:15: error:
> > > 'twopk' may be used uninitialized in this
> > > function /opt/src/lib/libm/src/s_exp2.c:346:15: note: 'twopk' was
> > > declared here /opt/src/lib/libm/src/s_exp2.c:346:22: error:
> > > 'twopkp1000' may be used uninitialized in this
> > > function /opt/src/lib/libm/src/s_exp2.c:346:22: note: 'twopkp1000'
> > > was declared here *** [s_exp2.o] Error code 1 nbmake: stopped
> > > in /opt/src/lib/libm 1 error
> > 
> > The warning is bogus, can you please try if making the common if
> > expression a local variable helps gcc to detect it?  Something like:
> > 
> >   bool use_unscaled = k >= -1021 << 20;
> > 
> > and then use if (use_unscaled) ... in both places?
> > 
> > If that doesn't help, just initialize both variables to 0.0 at
> > declaration.
> > 
> > Martin
> 
> Well unfortunately after fixing the above error, I got other, similar
> "may be used uninitialized" errors in other files. I'm now building
> everything with default optimization flags to avoid the hassle.



I also got this error when building netbsd-6 with -Os (for my
Soekris router).  With just -O instead it builds fine indeed.


        Geert


-- 
geert.hendrickx.be :: geert%hendrickx.be@localhost :: PGP: 0xC4BB9E9F
This e-mail was composed using 100% recycled spam messages!


Home | Main Index | Thread Index | Old Index