tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] casting bug?


From: Felix Nawothnig
Subject: Re: [Tinycc-devel] casting bug?
Date: Tue, 12 Jul 2005 17:32:37 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

Alexander Strasser wrote:
Maybe it is really best to use special types like int_fast32_t
these times... (or role your own set of types to replace them
with the appropriate type depending on compiler and arch).
There is no such thing as a fast 32bit integer on sane (read: non x86-64) 64bit architectures.
Sorry, I don't get what you say here.
What I said was especially in regard to the decision of some
compilers to use the LP64 or LLP64 type models.

Sorry, I don't get what you mean here.

We already have fixed size types like int32_t which are guaranteed to be exactly 32bit wide, although using them might result in slow code if they are not natively supported by the architecture.

Then we have "int" which is at least 16bit wide and should be the native register size (I dunno if the standard specifically says this but that's the way it was before the (x86) empire), so should be the "fastest" type (unless we talk about 8-bit CPUs for which ANSI C isn't really suited anyway :)

This is no longer true for many modern compilers due to zillions of people who wrote unportable C - and this is the problem. It could have been avoided maybe if fixed size types were introduced much earlier than in 1999 (?) though...

You can't have both a guaranteed size and guaranteed performance (while being portable), so what would your proposed "int_fast32_t" be then?

Felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]