[cfe-dev] Integer and Float type definitions with respect to bits number

Joshua Cranmer 🐧 Pidgeot18 at gmail.com
Mon Nov 11 21:16:41 PST 2013


On 11/10/2013 9:38 AM, Mehmet Erol Sanliturk wrote:
>
> Dears All ,
>
>
> It seems that , in Clang , there is no a type system like the following :

The <stdint.h> header provides typedefs for {,u}int{8,16,32,64}_t 
definitions, and I would heartily recommend that anyone using C or C++ 
use these typedefs instead of unadulterated char/short/int/long/long 
long. However, the compiler can only provide the ambiguously-sized int 
et al (and refer to them as such internally), since to change that would 
be to potentially break the ABI of existing code.

> Float_48_Bits
> Float_64_Bits
> Float_80_Bits
> Float_128_Bits
The situation for floating point is not as clear cut. While there is a 
rough consensus that float and double refer to what IEEE 754 calls 
binary32 and binary64, the long double can in practice mean either x86's 
80-bit precision format, IEEE's binary128, or the PPC double-double 
format. Some of these formats don't cleanly map on to the IEEE 754 
hierarchy of floating point (which is why LLVM specifies floating point 
types not as a generic fN but as an enumerated, closed set of possible 
values).

-- 
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist




More information about the cfe-dev mailing list