On Thu, 2013-08-08 at 15:49 +0530, Viresh Kumar wrote:
On 8 August 2013 15:44, Jon Medhurst (Tixy) tixy@linaro.org wrote:
I was proposing that as a fix for the "may be used uninitialized" warning. :-) If we use a local variable then the compiler knows both if clauses are always executed or not as a pair and so knows the variable isn't used uninitialised. Seems the safest fix to me as it lets the compiler warn us about any dodgy use of that variable that may creep in in the future.
Hmm... because currently it is based on calling a function and its outcome isn't constant..
Yes, though actually it's just a global variable.
If compiler is smart enough to suppress this warning with the code you just suggested, I wouldn't have any issues with it..
Do you think I would have proposed it without testing it ;-)
You want the patch from me now? Or you can take care of it?
I'm happy to fold in that change to the original patch, I'll follow up to this reply with the end result.