digitalmars.D - Recommendation: Compile DMD with More Warnings
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (19/19) Apr 06 2014 I recommend the lead developers of DMD to look into activating
- Andrei Alexandrescu (6/24) Apr 06 2014 I'm not a regular core dmd dev but I'm already seeing warnings with
- Orvid King (16/54) Apr 06 2014 If you want, I have the results of a static analysis of DMD that
- bearophile (5/10) Apr 06 2014 I'd like dmd/ldc2 compilers to compile with warnings active on
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (4/14) Apr 06 2014 Could you give me a priority list of the typical warning types
- bearophile (5/7) Apr 06 2014 I can't, I don't understand your question, and I don't understand
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (1/3) Apr 06 2014 Just so I know where I should begin digging ;)
- David Nadlinger (11/13) Apr 06 2014 LDC is actually built with -Wall -Wextra by default. The warnings
- Iain Buclaw (8/13) Apr 06 2014 disabled for the DMD source files though, as leaving them on just floods
- Walter Bright (2/9) Apr 06 2014 Yes, please post.
- Brad Roberts (2/11) Apr 07 2014 ... to bugzilla.
- Suliman (4/4) Apr 06 2014 Who could explain. AFAIK D was position as language without
- Iain Buclaw (7/8) Apr 06 2014 idea was in that code maybe correct or wrong, without any intermediate
- Daniel Murphy (3/4) Apr 07 2014 Don't forget we'll soon be switching away from gcc/clang/msvc for compil...
- bearophile (6/8) Apr 07 2014 So performing some static analysis before the switch looks like a
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (1/3) Apr 07 2014 To compiling it with DMD!?
- Daniel Murphy (3/6) Apr 07 2014 Exactly!
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (4/5) Apr 07 2014 How soon will this happen?
- Daniel Murphy (5/10) Apr 07 2014 None, initially. It currently produces D code almost identical to the C...
- asman (3/23) Apr 07 2014 Could be great too if someone run a static analyzer like on dmd
- bearophile (4/6) Apr 07 2014 This was done some time ago (with the big brother of CppCat).
- Walter Bright (3/5) Apr 07 2014 The static analyzer PVS-Studio was run on dmd last year. It found 2 bugs...
- Orvid King (5/10) Apr 07 2014 The results for Intel's compiler are just waiting for someone to
- Walter Bright (3/13) Apr 07 2014 Please just email it to me. I don't think it's useful to post such gigan...
- asman (3/22) Apr 07 2014 Could this forum has basic HTML support? code highlight or even
- Walter Bright (3/5) Apr 07 2014 Not worth the complexity, bandwidth, security issues, not all newsreader...
- H. S. Teoh (9/11) Apr 07 2014 Please don't. I don't use a HTML mail reader, and I never will. All the
- Mike Parker (4/7) Apr 07 2014 Not everyone uses the web interface. Some people are using the
- Dicebot (10/17) Apr 08 2014 We can possibly support code highlighting same as vibe.d
- John Colvin (2/21) Apr 08 2014 This is the only bit of formatting I'd be interested in.
- Orvid King (4/22) Apr 09 2014 As suggested I've posted it as an attachment to an issue,
- Walter Bright (2/4) Apr 09 2014 Thanks!
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.
Apr 06 2014
On 4/6/14, 2:49 AM, "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.I'm not a regular core dmd dev but I'm already seeing warnings with clang on OSX and I think fixing them would be beneficial. I'd support a pull request. In all likelihood it would also need to fix the warnings themselves, so you may want to enable only a few warnings at a time so as to keep the pull request sizes manageable. -- Andrei
Apr 06 2014
On Sunday, 6 April 2014 at 16:27:50 UTC, Andrei Alexandrescu wrote:On 4/6/14, 2:49 AM, "Nordlöw" 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) On the topic of actual warnings, I would be careful with them, because compiling DMD with MSVC with the maximum warning level (essentially -Wall), it produces 150k lines of output, most of them about stuff being inlined, and quite a bit of other stuff that you quite simply, don't care about.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.I'm not a regular core dmd dev but I'm already seeing warnings with clang on OSX and I think fixing them would be beneficial. I'd support a pull request. In all likelihood it would also need to fix the warnings themselves, so you may want to enable only a few warnings at a time so as to keep the pull request sizes manageable. -- Andrei
Apr 06 2014
Orvid King:On the topic of actual warnings, I would be careful with them, because compiling DMD with MSVC with the maximum warning level (essentially -Wall), it produces 150k lines of output, most of them about stuff being inlined, and quite a bit of other stuff that you quite simply, don't care about.I'd like dmd/ldc2 compilers to compile with warnings active on default, plus to have a switch to disable them. Bye, bearophile
Apr 06 2014
On Sunday, 6 April 2014 at 17:39:38 UTC, bearophile wrote:Orvid King:Could you give me a priority list of the typical warning types sorted an descending severity? /PerOn the topic of actual warnings, I would be careful with them, because compiling DMD with MSVC with the maximum warning level (essentially -Wall), it produces 150k lines of output, most of them about stuff being inlined, and quite a bit of other stuff that you quite simply, don't care about.I'd like dmd/ldc2 compilers to compile with warnings active on default, plus to have a switch to disable them. Bye, bearophile
Apr 06 2014
Nordlöw:Could you give me a priority list of the typical warning types sorted an descending severity?I can't, I don't understand your question, and I don't understand why you want such list. Bye, bearophile
Apr 06 2014
I can't, I don't understand your question, and I don't understand why you want such list.Just so I know where I should begin digging ;)
Apr 06 2014
On Sunday, 6 April 2014 at 17:39:38 UTC, bearophile wrote:I'd like dmd/ldc2 compilers to compile with warnings active on default, plus to have a switch to disable them.LDC is actually built with -Wall -Wextra by default. The warnings are disabled for the DMD source files though, as leaving them on just floods the console output, making actual issues much harder to see. We will have to look into additionally adding warning push/pop pragmas around the frontend includes in the "proper" LDC source files though. Currently, we get quite a bit of log spam from them, and some of them are unlikely to be addressed in the upstream source. David
Apr 06 2014
On 6 Apr 2014 21:15, "David Nadlinger" <code klickverbot.at> wrote:On Sunday, 6 April 2014 at 17:39:38 UTC, bearophile wrote:plus to have a switch to disable them.I'd like dmd/ldc2 compilers to compile with warnings active on default,LDC is actually built with -Wall -Wextra by default. The warnings aredisabled for the DMD source files though, as leaving them on just floods the console output, making actual issues much harder to see.We will have to look into additionally adding warning push/pop pragmasaround the frontend includes in the "proper" LDC source files though. Currently, we get quite a bit of log spam from them, and some of them are unlikely to be addressed in the upstream source.You should have more abstraction in LDC between the two frontend layers. :)
Apr 06 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.
Apr 06 2014
On 4/6/14, 10:38 PM, Walter Bright wrote:On 4/6/2014 9:45 AM, Orvid King wrote:... to bugzilla.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.
Apr 07 2014
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.
Apr 06 2014
On 7 Apr 2014 06:20, "Suliman" <evermind live.ru> wrote:Who could explain. AFAIK D was position as language without warnings. Theidea 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.
Apr 06 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.
Apr 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
Apr 07 2014
Don't forget we'll soon be switching away from gcc/clang/msvc for compiling the frontend.To compiling it with DMD!?
Apr 07 2014
""Nordlöw"" wrote in message news:ysueyapbcgrupyrikmhq forum.dlang.org...Exactly! https://github.com/D-Programming-Language/dmd/pull/3410Don't forget we'll soon be switching away from gcc/clang/msvc for compiling the frontend.To compiling it with DMD!?
Apr 07 2014
https://github.com/D-Programming-Language/dmd/pull/3410How soon will this happen? What kind of D style programming will DDMD enable not possible in C++? Will it for example make use of array slicing?
Apr 07 2014
""Nordlöw"" wrote in message news:obdtzcdsjzjzttjkpjxf forum.dlang.org...Hopefully in the next few months.https://github.com/D-Programming-Language/dmd/pull/3410How soon will this happen?What kind of D style programming will DDMD enable not possible in C++?None, initially. It currently produces D code almost identical to the C++ code. Once development has switched over, we can go through and start refactoring it to use foreach, ranges, delegates, etcWill it for example make use of array slicing?Most likely.
Apr 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
Apr 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 WindowsThis was done some time ago (with the big brother of CppCat). Bye, bearophile
Apr 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 WindowsThe static analyzer PVS-Studio was run on dmd last year. It found 2 bugs, and several thousand false positives.
Apr 07 2014
On Monday, 7 April 2014 at 17:05:46 UTC, Walter Bright wrote:On 4/7/2014 6:48 AM, asman wrote: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)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 WindowsThe static analyzer PVS-Studio was run on dmd last year. It found 2 bugs, and several thousand false positives.
Apr 07 2014
On 4/7/2014 10:15 AM, Orvid King wrote:On Monday, 7 April 2014 at 17:05:46 UTC, Walter Bright wrote:Please just email it to me. I don't think it's useful to post such gigantic files. Also, being a text forum, posting zip files is not terribly useful, either.On 4/7/2014 6:48 AM, asman wrote: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)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 WindowsThe static analyzer PVS-Studio was run on dmd last year. It found 2 bugs, and several thousand false positives.
Apr 07 2014
On Monday, 7 April 2014 at 17:49:01 UTC, Walter Bright wrote:On 4/7/2014 10:15 AM, Orvid King wrote:Could this forum has basic HTML support? code highlight or even some text formatting in text itself could be very useful, either.On Monday, 7 April 2014 at 17:05:46 UTC, Walter Bright wrote:Please just email it to me. I don't think it's useful to post such gigantic files. Also, being a text forum, posting zip files is not terribly useful, either.On 4/7/2014 6:48 AM, asman wrote: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)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 WindowsThe static analyzer PVS-Studio was run on dmd last year. It found 2 bugs, and several thousand false positives.
Apr 07 2014
On 4/7/2014 12:02 PM, asman wrote:Could this forum has basic HTML support? code highlight or even some text formatting in text itself could be very useful, either.Not worth the complexity, bandwidth, security issues, not all newsreaders support that, etc.
Apr 07 2014
On Mon, Apr 07, 2014 at 07:02:11PM +0000, asman wrote: [...]Could this forum has basic HTML support? code highlight or even some text formatting in text itself could be very useful, either.Please don't. I don't use a HTML mail reader, and I never will. All the information that is relevant to D coding is adequately conveyed by plain text. HTML only adds unnecessary frills that contributes no substance while adding bloat. T -- MAS = Mana Ada Sistem?
Apr 07 2014
On Monday, 7 April 2014 at 19:02:13 UTC, asman wrote:Could this forum has basic HTML support? code highlight or even some text formatting in text itself could be very useful, either.Not everyone uses the web interface. Some people are using the mailing list interface, others using newsreaders, and not everyone is using a client that supports HTML.
Apr 07 2014
On Tuesday, 8 April 2014 at 03:44:40 UTC, Mike Parker wrote:On Monday, 7 April 2014 at 19:02:13 UTC, asman wrote:We can possibly support code highlighting same as vibe.d newsgroup web interface does: just render ``` code here ``` blocks as code snippets (example: http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/15414/) while still showing them as normal text in mails / NG clients. Feels natural to any GitHub user.Could this forum has basic HTML support? code highlight or even some text formatting in text itself could be very useful, either.Not everyone uses the web interface. Some people are using the mailing list interface, others using newsreaders, and not everyone is using a client that supports HTML.
Apr 08 2014
On Tuesday, 8 April 2014 at 12:40:16 UTC, Dicebot wrote:On Tuesday, 8 April 2014 at 03:44:40 UTC, Mike Parker wrote:This is the only bit of formatting I'd be interested in.On Monday, 7 April 2014 at 19:02:13 UTC, asman wrote:We can possibly support code highlighting same as vibe.d newsgroup web interface does: just render ``` code here ``` blocks as code snippets (example: http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/15414/) while still showing them as normal text in mails / NG clients. Feels natural to any GitHub user.Could this forum has basic HTML support? code highlight or even some text formatting in text itself could be very useful, either.Not everyone uses the web interface. Some people are using the mailing list interface, others using newsreaders, and not everyone is using a client that supports HTML.
Apr 08 2014
On Mon, 07 Apr 2014 12:49:05 -0500, Walter Bright <newshound2 digitalmars.com> wrote:On 4/7/2014 10:15 AM, Orvid King wrote:As suggested I've posted it as an attachment to an issue, https://issues.dlang.org/show_bug.cgi?id=12552On Monday, 7 April 2014 at 17:05:46 UTC, Walter Bright wrote:Please just email it to me. I don't think it's useful to post such gigantic files. Also, being a text forum, posting zip files is not terribly useful, either.On 4/7/2014 6:48 AM, asman wrote: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)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 WindowsThe static analyzer PVS-Studio was run on dmd last year. It found 2 bugs, and several thousand false positives.
Apr 09 2014
On 4/9/2014 11:10 AM, Orvid King wrote:As suggested I've posted it as an attachment to an issue, https://issues.dlang.org/show_bug.cgi?id=12552Thanks!
Apr 09 2014