Re: Somehow give a warning when trying to assign a size_t/ptrdiff_t to int or uint

2016-04-17 Thread Mike Parker via Digitalmars-d
On Sunday, 17 April 2016 at 11:26:02 UTC, Walter Bright wrote: My experience is that over time one gets used to writing 32/64 bit portable code naturally, and the minor irritations don't happen anymore. D isn't a language that tries to hide the differences, and one should be aware of them. A

Re: Somehow give a warning when trying to assign a size_t/ptrdiff_t to int or uint

2016-04-17 Thread Walter Bright via Digitalmars-d
On 4/17/2016 2:29 AM, WebFreak001 wrote: It's annoying to fix all these `int index = str.indexOf("something")` to size_t/ptrdiff_t because you started writing the code thinking that indexOf returns an integer even though it returns a ptrdiff_t. When porting code from 32bit to 64bit you need to fi

Re: Somehow give a warning when trying to assign a size_t/ptrdiff_t to int or uint

2016-04-17 Thread Jonathan M Davis via Digitalmars-d
On Sunday, April 17, 2016 09:51:07 WebFreak001 via Digitalmars-d wrote: > On Sunday, 17 April 2016 at 09:38:33 UTC, Temtaime wrote: > > On Sunday, 17 April 2016 at 09:29:33 UTC, WebFreak001 wrote: > >> It's annoying to fix all these `int index = > >> str.indexOf("something")` to size_t/ptrdiff_t be

Re: Somehow give a warning when trying to assign a size_t/ptrdiff_t to int or uint

2016-04-17 Thread WebFreak001 via Digitalmars-d
On Sunday, 17 April 2016 at 09:38:33 UTC, Temtaime wrote: On Sunday, 17 April 2016 at 09:29:33 UTC, WebFreak001 wrote: It's annoying to fix all these `int index = str.indexOf("something")` to size_t/ptrdiff_t because you started writing the code thinking that indexOf returns an integer even th

Re: Somehow give a warning when trying to assign a size_t/ptrdiff_t to int or uint

2016-04-17 Thread Temtaime via Digitalmars-d
On Sunday, 17 April 2016 at 09:29:33 UTC, WebFreak001 wrote: It's annoying to fix all these `int index = str.indexOf("something")` to size_t/ptrdiff_t because you started writing the code thinking that indexOf returns an integer even though it returns a ptrdiff_t. When porting code from 32bit

Somehow give a warning when trying to assign a size_t/ptrdiff_t to int or uint

2016-04-17 Thread WebFreak001 via Digitalmars-d
It's annoying to fix all these `int index = str.indexOf("something")` to size_t/ptrdiff_t because you started writing the code thinking that indexOf returns an integer even though it returns a ptrdiff_t. When porting code from 32bit to 64bit you need to fix all these lines which can quickly bec