Recommendation: Compile DMD with More Warnings

"Nordlöw" per.nordlow at gmail.com
Sun Apr 6 02:49:58 PDT 2014


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.


More information about the Digitalmars-d mailing list