On Thu, 16 May 2013, DJ Delorie wrote:

> SIZE_TYPE is compared - with individual strcmp's! - against a fixed
> set of C types, instead of using some sort of table lookup to support
> non-power-of-two types.

Joern had a patch (as of December 2010, possibly updated since then) to 
convert at least some such macros to use enum values (stdint.h ones, 
anyway) to use enum values rather than strings as a cleaner API.

Though that wouldn't be sufficient for what you want.  The front-end type 
pieces of Bernd's changes didn't go in, since they embedded things 
specific to 40-bit types all over the place rather than providing a more 
general infrastructure for types of architecture-specific precision.  
Logically I'd like a way for an architecture to define a set of precisions 
for which there are __intN keywords and associated __intN, unsigned __intN 
types (plus the _Complex versions of those).  Then maybe the values given 
for types such as SIZE_TYPE would be either an enum value for a standard 
type, or e.g. ITK_INTN (40) or ITK_UNSIGNED_INTN (40), where ITK_INTN 
expands to some expression giving a value of the enum type not 
corresponding to any of the standard named types.

Likewise for floating-point types.  DTS 18661-3 (the third part of the 
draft ISO C bindings to IEEE 754-2008) defines types

_FloatN, where N is 16, 32, 64, or >= 128 and a multiple of 32
_DecimalN, where N >= 32 and a multiple of 32

and _Complex variants of the _FloatN types, where the particular set 
supported depends on the implementation (and so for GCC would depend on 
the architecture).  Again, these should be keywords.

(I don't think any of the above should be particularly hard to implement.)

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to