Re: [cc65] Type conversions

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-12-20 18:40:52


On Fri, Dec 20, 2002 at 10:47:12AM -0500, shubel, paul wrote:
> I have always viewed this issue as a MAJOR portability issue of "C" code.
> Namely, each compiler defaults to a standard size when evaluating
> expressions.
> For example, why couldn't the standard be that the compiler must evaluate
> all
> expressions with its maximum INT size?

Because it is slow, and one of the features of C is speed. Besides that,
            
        int a = 10000, b = 10000;
        int c = a * b;

will still fail, even if the expression is evaluated using long arithmetic, so
your suggestion does not help.

I don't have a problem with characteristics like that. C does not enforce
portability, but it will allow much more portability than most other
languages. This results in less limitations for the compiler, which allows
faster code on most platforms. The drawback is that you will have to know that
the standard guarantees and what not.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-12-20 18:40:56 CET