Coverity tool

Ellery Newcomer ellery-newcomer at utulsa.edu
Tue Feb 9 12:41:51 PST 2010


On 02/09/2010 02:18 PM, Walter Bright wrote:
> bearophile wrote:
>> Walter Bright:
>>> From what I can infer from their various statements, the primary
>>> thing it does is pair functions that must be paired, like
>>> malloc/free, lock/unlock, fopen/fclose, etc.
>>
>> I have never used their program, and probably I will never buy it,
>> but I have seen it used two times on the whole source code of
>> CPython, and it has found a good amount of bugs (that devs have fixed
>> in some weeks) despite such C sources are sometimes quite good (see
>> for example:
>> http://svn.python.org/view/python/trunk/Modules/_collectionsmodule.c?view=markup
>>
>> ) compared to the messy C sources of Perl or Ruby. So it's an useful
>> tool. Using D2 compiled with DMD is not an option for CPython devs,
>> they can't even use C99.
>
>
> I'm not disagreeing with you, I just think that Coverity doesn't have
> much use for D code, because what it checks for is already covered by
> the language.
>

I think a large part of the article proves your point: all those checks 
belong in the compiler, and not in a third party tool.

Still, there are lots of trivial or nontrivial or fuzzy or advanced 
analyses that DMD doesn't perform. A dumb example would be

version(1){
     pragma(msg, "1");
}else version(2){
     pragma(msg, "2");
}




More information about the Digitalmars-d mailing list