Compiler switch for integer comparison/promotion to catch a simple error

frame frame86 at live.com
Sun May 29 01:35:23 UTC 2022


Is there a compiler switch to catch this kind of error?

```d
ulong v = 1;
writeln(v > -1);
```

IMHO the compiler should bail a warning if it sees a logic 
comparison between signed and unsigned / different integer sizes. 
There is 50% chance that a implicit conversion was not intended.


More information about the Digitalmars-d-learn mailing list