[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] casting bug?
From: |
Dave Dodge |
Subject: |
Re: [Tinycc-devel] casting bug? |
Date: |
Tue, 12 Jul 2005 19:21:00 -0400 |
User-agent: |
Mutt/1.4.2i |
On Tue, Jul 12, 2005 at 09:44:09PM +0200, Alexander Strasser wrote:
> Felix Nawothnig wrote:
> > You can't have both a guaranteed size and guaranteed performance (while
> > being portable), so what would your proposed "int_fast32_t" be then?
>
> It's not my proposed type, this exists already I don't know if it is
> covered by C99 or not.
Yes, it's standard in C99 assuming you include <stdint.h>. For N = 8,
16, 32, and 64, C99 has these typedefs:
intN_t, uintN_t
Exact-width integers. The type has exactly N value bits.
These are required only if the implementation has an underlying
integer type of the proper size available.
int_leastN_t, uint_leastN_t
Minimum-width integers. The type will be the smallest type with
at least N value bits (but possibly more than N). These are
required.
int_fastN_t, uint_fastN_t
Fastest minimum-width integers. The type will be the "fastest"
(for all purposes, as decided by the implementation) type with
at least N value bits (but possibly more than N). These are
required.
C99 also standardizes:
intptr_t, uintptr_t
A void pointer converted to this integer type, then back to a void
pointer again, shall compare equal to the original pointer. These
are optional.
intmax_t, uintmax_t
Greatest-width integers. This type is capable of representing any
value of any integer type. These are required.
A related header is <inttypes.h>, which declares some string
conversion functions and provides format specifiers for the <stdint.h>
types. For example to print a uint32_t portably, you would do
something like this:
uint32_t x;
...
printf("%" PRIu32 "\n",x);
-Dave Dodge
- Re: [Tinycc-devel] casting bug?, (continued)
- Re: [Tinycc-devel] casting bug?, Dave Dodge, 2005/07/11
- Re: [Tinycc-devel] casting bug?, Felix Nawothnig, 2005/07/11
- Re: [Tinycc-devel] casting bug?, Dave Dodge, 2005/07/11
- Re: [Tinycc-devel] casting bug?, Greg Haerr, 2005/07/11
- Re: [Tinycc-devel] casting bug?, Henrik Nordstrom, 2005/07/11
- Re: [Tinycc-devel] casting bug?, Alexander Strasser, 2005/07/12
- Re: [Tinycc-devel] casting bug?, Felix Nawothnig, 2005/07/12
- Re: [Tinycc-devel] casting bug?, Alexander Strasser, 2005/07/12
- Re: [Tinycc-devel] casting bug?, Felix Nawothnig, 2005/07/12
- Re: [Tinycc-devel] casting bug?, Alexander Strasser, 2005/07/12
- Re: [Tinycc-devel] casting bug?,
Dave Dodge <=
- Re: [Tinycc-devel] casting bug?, Felix Nawothnig, 2005/07/12
- Re: [Tinycc-devel] casting bug?, Alexander Strasser, 2005/07/18
- Re: [Tinycc-devel] casting bug?, Dave Dodge, 2005/07/12
- Re: [Tinycc-devel] casting bug?, Dave Dodge, 2005/07/12
- Re: [Tinycc-devel] casting bug?, lepton, 2005/07/12