Uninitialized variable in profile.c
Rick Walsh
rickmwalsh at gmail.com
Sun Dec 17 15:10:14 PST 2017
On 18 Dec. 2017 12:20 am, "Berthold Stoeger" <bstoeger at mail.tuwien.ac.at>
wrote:
Hi Rick,
In current master, gcc produces an uninitialized variable warning in
profile.c,
which seems correct to me.
In l.1044 last_ceiling is compared to first_ceiling, but last_ceilng is set
first in l.1056. I guess decoMode() cannot change in this function, so gcc's
analysis seems correct.
There is another warning concerning entry in l.807. To make the warning go
away, you could add a
if (pi->nr <= 0)
return;
block before the loop. Even if pi->nr can never be <= 0, this seems like a
good idea for robustness' sake.
Hi Berthold,
Timezone differences mean I missed this discussion. My experience in
programming is limited and entirely informal. So long as the result is as
expected, I will happily defer to the judgement of you, Dirk and Robert.
Cheers,
Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171218/66041c6b/attachment.html>
More information about the subsurface
mailing list