Recommendation: Compile DMD with More Warnings

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Apr 6 09:27:38 PDT 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


More information about the Digitalmars-d mailing list