A strange div bug on Linux x86_64, (both dmd & ldc2): long -5000 / size_t 2 = 9223372036854773308

mw mingwu at gmail.com
Thu Aug 13 23:54:57 UTC 2020


On Thursday, 13 August 2020 at 23:47:30 UTC, Walter Bright wrote:
> On 8/13/2020 3:27 PM, mw wrote:
>> For users / applications that do value correctness more than 
>> performance, can we have a compiler switch which turn all the 
>> types & operations (e.g. in modules, that users also specified 
>> on command-line) into core_checkedint or 
>> std_experimental_checkedint *automatically*?
>
>
> The thing about checkedint is there are several different 
> behaviors one might choose as responses to overflow. There is 
> no one-size-fits-all, if we did pick one we'll inevitably have 
> complaints.

I’ve seen the different hooks, and was just about to add:

If we choose this approach, the hook can also have its own 
command line option to let the user in explicit full control of 
what the integer operation behavior s/he really wants for his/her 
application.




More information about the Digitalmars-d mailing list