DIP(?) Warning to facilitate porting to other archs

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 06:16:59 PDT 2014


Temtaime:

> I think it's need to have -w64(or other name, offers ?) flag 
> that warns if code may not compile on other archs.

Some of the things it has to guard against:

void main() {
     size_t x;
     ptrdiff_t y;
     uint r1 = x; // warn
     int  r2 = x; // warn
     uint r3 = y; // warn
     int  r4 = y; // warn
     char[] data;
     foreach (uint i, c; data) {} // warn
     foreach (int i, c; data) {} // warn
}

Is something missing?

Bye,
bearophile


More information about the Digitalmars-d mailing list