Portability bug in integral conversion

Graham St Jack Graham.StJack at internode.on.net
Sun Jan 16 23:07:06 PST 2011


On 17/01/11 14:16, Jonathan M Davis wrote:
> On Sunday 16 January 2011 19:38:55 Andrei Alexandrescu wrote:
>> On 1/16/11 9:32 PM, Graham St Jack wrote:
>>> Is the cost of run-time checking really prohibitive?
>> Yes. There is no question about that. This is not negotiable.
> Well, since it would mean checking a condition every time that you did
> arithmetic, that would likely _at least_ double the cost of doing any
> arithmetic. And particularly since arithmetic is such a basic operation that
> _everything else_ relies on, that could get really expensive, really fast.
>
> Yeah. I don't think that that's negotiable. Absolutely best case, I could see
> adding a compiler flag to enable it for debugging purposes, but it would
> definitely be expensive to do such checks and would be totally unacceptable in
> the release build of a systems programming language.
>
> - Jonathan M Davis
Yes, I agree that checking all the time would be too expensive. What I 
meant was that we could provide functions that could do appropriate 
checking when it is needed.

Andrei didn't like the functions idea, suggesting types that do 
policy-based checking, which I am happy with.

-- 
Graham St Jack



More information about the Digitalmars-d mailing list