April 07, 2014
On 7 Apr 2014 06:20, "Suliman" <evermind@live.ru> wrote:
>
> Who could explain. AFAIK D was position as language without warnings. The
idea was in that code maybe correct or wrong, without any intermediate state, and now I am reading about warnings.

This thread is talking about the compiler implementation (written in C++). As for D's stance on warnings, it's pretty much only used for features being removed, as part of our deprecate/warn/error process.

Code that is considered incorrect is always an error.


April 07, 2014
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.
April 07, 2014
""Nordlöw""  wrote in message news:qjwcprwdvrwyvrbftnto@forum.dlang.org...

> I can do a pull request if desired for the posix.make update if wanted.

Don't forget we'll soon be switching away from gcc/clang/msvc for compiling the frontend. 

April 07, 2014
Daniel Murphy:

> Don't forget we'll soon be switching away from gcc/clang/msvc for compiling the frontend.

So performing some static analysis before the switch looks like a good idea to make the switch smoother and safer. Also because the static analysis tools for the D code are much less good.

Bye,
bearophile
April 07, 2014
On Sunday, 6 April 2014 at 09:49:59 UTC, Nordlöw wrote:
> I recommend the lead developers of DMD to look into activating more warnings in the dmd/src/posix.mak.
>
> GCC 4.8.2 and especially Clang 3.4, both prepackage on Ubuntu 13.10/14.04 give a *lot* of warnings that seems to indicate potential bugs in the DMD source code.
>
> This setting gives useful warnings and at the same time avoid the annoying ones
>
> WARNINGS=-Wall -Wextra -Wno-deprecated -Wstrict-aliasing -Wno-unused-parameter -Wno-unused-variable -Wunused-function -Wno-unused-label -Wno-unknown-pragmas -Wno-sign-compare -Wno-overloaded-virtual -Wno-missing-braces -Wno-missing-field-initializers -Wno-logical-op-parentheses
>
> For example there a *lot* of -Wsometimes-uninitialized which IMHO seems like the most dangereous ones. This one is however Clang specific but I have not had any problems running a Clang compiled version of DMD. Further Clang compiles DMD about twices as fast as GCC. Good work developers on disabling use of STL in DMD!
>
> I can do a pull request if desired for the posix.make update if wanted.

Could be great too if someone run a static analyzer like on dmd
code http://www.cppcat.com I'll try when I back to Windows
April 07, 2014
asman:

> Could be great too if someone run a static analyzer like on dmd
> code http://www.cppcat.com I'll try when I back to Windows

This was done some time ago (with the big brother of CppCat).

Bye,
bearophile
April 07, 2014
> Don't forget we'll soon be switching away from gcc/clang/msvc for compiling the frontend.

To compiling it with DMD!?
April 07, 2014
""Nordlöw""  wrote in message news:ysueyapbcgrupyrikmhq@forum.dlang.org...

> > Don't forget we'll soon be switching away from gcc/clang/msvc for compiling the frontend.
>
> To compiling it with DMD!?

Exactly!

https://github.com/D-Programming-Language/dmd/pull/3410 

April 07, 2014
On 4/7/2014 6:48 AM, asman wrote:
> Could be great too if someone run a static analyzer like on dmd
> code http://www.cppcat.com I'll try when I back to Windows

The static analyzer PVS-Studio was run on dmd last year. It found 2 bugs, and several thousand false positives.
April 07, 2014
On Monday, 7 April 2014 at 17:05:46 UTC, Walter Bright wrote:
> On 4/7/2014 6:48 AM, asman wrote:
>> Could be great too if someone run a static analyzer like on dmd
>> code http://www.cppcat.com I'll try when I back to Windows
>
> The static analyzer PVS-Studio was run on dmd last year. It found 2 bugs, and several thousand false positives.

The results for Intel's compiler are just waiting for someone to approve the post, as it's 72kb in a 7z file. (posts larger than 40kb have to be manually approved according to the email that got sent back to me)