Undefined behaviors & Clang 3.3

qznc qznc at web.de
Fri Jun 21 08:51:50 PDT 2013


On Friday, 21 June 2013 at 13:48:19 UTC, eles wrote:
> On Friday, 21 June 2013 at 10:42:32 UTC, bearophile wrote:
>> qznc:
>>
>>> In D an integer overflow is defined, so there is no need to 
>>> detect anything about it.
>>
>> A language should offer the programmer a way to specify when 
>> an integral overflow is acceptable. Otherwise the other cases 
>> are bugs. Clang 3.3 helps find some of those bugs.
>
> I just wanted to say almost the same thing: that the original 
> sentence should read:
>
>
> "In D an integer overflow is *badly or, at least, questionably 
> and inflexibly* defined, so there is no *possibility* to detect 
> anything *useful* about it."
>
> Well, that was the flame for today.

The D definition mirrors what modern PC architectures do and 
hence can be compiled efficiently there. C avoids coupling with 
any architecture hence "undefined".

What architectures do not wrap around?


More information about the Digitalmars-d mailing list