www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - another warnings question

reply "Carlos Santander B." <csantander619 gmail.com> writes:
I'm not comfortable with this behavior:

//----------------------
import foo;
void main() {}
//----------------------

Compiled with warnings enabled, DMD checks warnings for "foo" too. While 
it could be a good thing when "foo" is my own code, I don't like it when 
it's part of another project (I think C and C++ do the same thing, but 
it's not actually relevant). This is particularly bad right now that DMD 
is treating warnings as errors and stopping really fast when finding 
warnings. So, there I was wanting to check a small program of mine for 
possible warnings, and DMD didn't say a word about it but just 
complained about MinTL (which my program uses).

In conclussion, with the current status quo, I can't check my program. 
My proposal: don't enable warnings for imported modules. Any thoughts?

_______________________
Carlos Santander Bernal
Mar 08 2005
parent Ben Hinkle <Ben_member pathlink.com> writes:
In article <d0lm6u$tmk$1 digitaldaemon.com>, Carlos Santander B. says...
I'm not comfortable with this behavior:

//----------------------
import foo;
void main() {}
//----------------------

Compiled with warnings enabled, DMD checks warnings for "foo" too. While 
it could be a good thing when "foo" is my own code, I don't like it when 
it's part of another project (I think C and C++ do the same thing, but 
it's not actually relevant). This is particularly bad right now that DMD 
is treating warnings as errors and stopping really fast when finding 
warnings. So, there I was wanting to check a small program of mine for 
possible warnings, and DMD didn't say a word about it but just 
complained about MinTL (which my program uses).
I tried running -w with MinTL, too, and got through about 1/2 of a file before it kept halting the compile on if-return early exits saying everything else is unreachable. I gave up after commenting out two of those just as a last gasp at trying -w. Hopefully once that gets fixed -w will be meaningful on MinTL.
In conclussion, with the current status quo, I can't check my program. 
My proposal: don't enable warnings for imported modules. Any thoughts?
That probably makes sense for non-templates but I have a feeling that checking templates will be worth it since there could be code paths that only get tickled after being instantiated. I don't know for sure, though.
_______________________
Carlos Santander Bernal
Mar 08 2005