This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: adding knowledge of the int_fastN_t types to the compiler

On Wed, 12 Mar 2008, FX Coudert wrote:

> I propose we implement target macros INT_FAST8_TYPE_SIZE (and so on for 16, 32
> and 64): they would be defined to -1 in defaults.h (meaning that int_fastN_t
> types are not available), and independent targets can redefine them.
> Front-ends and the middle-end can then use it if they feel like it. Attached
> is a patch implementing this idea, including target definitions for linux,
> darwin, mingw, AIX, IRIX, OpenBSD, Solaris 2.10.

TARGET_64BIT is not a constant but depends on command-line options and 
will not be defined at all for some GNU/Linux targets, so your Linux 
definition is incorrect.  I suggest runtime-variable values depending on a 
target-independent macro such as LONG_TYPE_SIZE.  Also remember the 
various GNU/Linux targets that do not use config/linux.h (alpha, rs6000, 

Note that the size is not enough for implementing <stdint.h>, you need the 
actual type as well to get C++ mangling right.  So I suggest using 
type-name strings as is done for the other standard typedefs, rather than 
having these macros different from all the others, even if at first you do 
not define all the information needed for all the other <stdint.h> types 
and so do not implement <stdint.h> itself.

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]