On Thu, Feb 26, 2009 at 12:47 PM, Rick R <[email protected]> wrote: > Would it be bad to rely on the C (Posix?) standard: <types.h> and the > int32_t int64_t etc. > And define a set of rules: > If the compiler is 64 bit, then the integral in BitC maps to int64_t, > if 32 bit int32_t etc. > Real/float/double same way.. but also allow overrides if necessary.
I'm having trouble understanding this proposal. BitC doesn't need to define a single integral type. We support multiple sizes of machine integers directly. The problem here is that the BitC int32 is 32 bits regardless of platform, whereas the C int has no particular specified size. What you seem to propose is to introduce convenience aliases. The problem with doing this is that: (define i:int32 1) (define j:word 2) ;; word is approximately C "int" ... (+ i j) will compile on 32-bit platforms but will fail to type check on 64-bit platforms. This is true because all arguments to arithmetic operators in BitC are required to be the same type. The "all same type" requirement is not something that we can realistically change. shap _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
