|
|
Log in / Subscribe / Register

One year of Coverity work

One year of Coverity work

Posted Aug 22, 2014 20:50 UTC (Fri) by mathstuf (subscriber, #69389)
In reply to: One year of Coverity work by etienne
Parent article: One year of Coverity work

When I see a self-initialized variable, I think "bug", not "here there be dragons". Make your assumptions explicit with a comment please.


to post comments

One year of Coverity work

Posted Aug 24, 2014 7:24 UTC (Sun) by johill (subscriber, #25196) [Link] (1 responses)

Additionally, if you *don't* initialize the variable then the compiler will be able to warn you if you later create a code path where you forgot...

One year of Coverity work

Posted Aug 31, 2014 12:11 UTC (Sun) by Wol (subscriber, #4433) [Link]

Okay, user-space code, but when I set coding standards at a company, the rule was "all warnings must be explained away".

The reason was precisely that - we had certain code (where we called a commercial library that then called-back our code) that we just couldn't suppress all warnings.

Sometimes you end up between a rock and a hard place, and things like "var = var" are an easy escape route...

Cheers,
Wol


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds