Recommendation: Compile DMD with More Warnings

Orvid King blah38621 at gmail.com
Mon Apr 7 06:13:18 PDT 2014


  On Mon, 07 Apr 2014 00:38:42 -0500, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 4/6/2014 9:45 AM, Orvid King wrote:
>> If you want, I have the results of a static analysis of DMD that I  
>> could post,
>> as processed in 23 hours and 58 minutes by Intel's C compiler, using  
>> 10gb of RAM
>> the entire time. If I can figure out how to have it not skip any  
>> methods (there
>> were still a significant number that it didn't analyze due to  
>> complexity limits)
>> I'll run it again and post the full results. In my basic look over the  
>> results,
>> there were a decent number of them that may actually be bugs. (buffer  
>> overruns,
>> and even a few instances of accessing memory after it had been freed)
>
> Yes, please post.

Under the assumption that most looking at it won't have Intel's inspector  
(I don't), I've only included the actual data file. That .pdr file is  
nothing more than an xml file. To locate the issues that may actually be  
issues, I use the following regex:
#(?!12112|12121|12144|12172|12192|12291|12382|12390|12412)[0-9]+

This uses the fact that the issue numbers are the only ones ever preceded  
by a # symbol, and ignores warnings 12112, 12121, 12144, etc.

This analysis is for the git-head version of DMD as it was about a week  
ago. The largest number of warnings are, unsurprisingly, for memory that  
is allocated but never freed. It might be worth looking at the warnings  
that I skipped, as they may only be in that list so I could see the other  
types of warnings it would emit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r000sc.7z
Type: application/octet-stream
Size: 141048 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140407/ed7fd6aa/attachment-0001.obj>


More information about the Digitalmars-d mailing list