Uninitialized variable in profile.c

Dirk Hohndel dirk at hohndel.org
Sun Dec 17 10:11:41 PST 2017


> On Dec 17, 2017, at 8:06 AM, Robert Helling <helling at atdotde.de> wrote:
> 
> Hi,
> 
>> On 17. Dec 2017, at 14:19, Berthold Stoeger <bstoeger at mail.tuwien.ac.at <mailto:bstoeger at mail.tuwien.ac.at>> wrote:
>> 
>> 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.
> 
> isn’t that what
> 
> assert(pi->nr >= 0);
> 
> is for?


Asserts are usually compiled out in production code. Not a huge fan of asserts, TBH

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171217/832d16e4/attachment.html>


More information about the subsurface mailing list