DMD warnings

Frank Benoit frank at nix.de
Tue Mar 14 07:56:21 PST 2006


Don Clugston schrieb:
> Example: a missing return statement definitely falls into this category.
> But in my experience, I don't think I have ever seen a single
> signed/unsigned mismatch that was a bug -- but I've seen that warning in
> C++ thousands upon thousands of times.
> 
Good point. "Missing casts" are really the mass of the warnings. And
adding hundreds of casts will make blind situations you described.
I think to bring in better cast statements, to give the compiler more
information.
Something like
sign(), unsign(): e.g. long->ulong, uint->int
shrink()        : e.g. int->short, ulong->ubyte, double->float
If the compiler knows better about the users intention, he could warn
better.

Frank



More information about the Digitalmars-d mailing list