gccint: Type Layout

1 
1 18.6 Layout of Source Language Data Types
1 =========================================
1 
1 These macros define the sizes and other characteristics of the standard
1 basic data types used in programs being compiled.  Unlike the macros in
1 the previous section, these apply to specific features of C and related
1 languages, rather than to fundamental aspects of storage layout.
1 
1  -- Macro: INT_TYPE_SIZE
1      A C expression for the size in bits of the type 'int' on the target
1      machine.  If you don't define this, the default is one word.
1 
1  -- Macro: SHORT_TYPE_SIZE
1      A C expression for the size in bits of the type 'short' on the
1      target machine.  If you don't define this, the default is half a
1      word.  (If this would be less than one storage unit, it is rounded
1      up to one unit.)
1 
1  -- Macro: LONG_TYPE_SIZE
1      A C expression for the size in bits of the type 'long' on the
1      target machine.  If you don't define this, the default is one word.
1 
1  -- Macro: ADA_LONG_TYPE_SIZE
1      On some machines, the size used for the Ada equivalent of the type
1      'long' by a native Ada compiler differs from that used by C.  In
1      that situation, define this macro to be a C expression to be used
1      for the size of that type.  If you don't define this, the default
1      is the value of 'LONG_TYPE_SIZE'.
1 
1  -- Macro: LONG_LONG_TYPE_SIZE
1      A C expression for the size in bits of the type 'long long' on the
1      target machine.  If you don't define this, the default is two
1      words.  If you want to support GNU Ada on your machine, the value
1      of this macro must be at least 64.
1 
1  -- Macro: CHAR_TYPE_SIZE
1      A C expression for the size in bits of the type 'char' on the
1      target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT'.
1 
1  -- Macro: BOOL_TYPE_SIZE
1      A C expression for the size in bits of the C++ type 'bool' and C99
1      type '_Bool' on the target machine.  If you don't define this, and
1      you probably shouldn't, the default is 'CHAR_TYPE_SIZE'.
1 
1  -- Macro: FLOAT_TYPE_SIZE
1      A C expression for the size in bits of the type 'float' on the
1      target machine.  If you don't define this, the default is one word.
1 
1  -- Macro: DOUBLE_TYPE_SIZE
1      A C expression for the size in bits of the type 'double' on the
1      target machine.  If you don't define this, the default is two
1      words.
1 
1  -- Macro: LONG_DOUBLE_TYPE_SIZE
1      A C expression for the size in bits of the type 'long double' on
1      the target machine.  If you don't define this, the default is two
1      words.
1 
1  -- Macro: SHORT_FRACT_TYPE_SIZE
1      A C expression for the size in bits of the type 'short _Fract' on
1      the target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT'.
1 
1  -- Macro: FRACT_TYPE_SIZE
1      A C expression for the size in bits of the type '_Fract' on the
1      target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT * 2'.
1 
1  -- Macro: LONG_FRACT_TYPE_SIZE
1      A C expression for the size in bits of the type 'long _Fract' on
1      the target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT * 4'.
1 
1  -- Macro: LONG_LONG_FRACT_TYPE_SIZE
1      A C expression for the size in bits of the type 'long long _Fract'
1      on the target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT * 8'.
1 
1  -- Macro: SHORT_ACCUM_TYPE_SIZE
1      A C expression for the size in bits of the type 'short _Accum' on
1      the target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT * 2'.
1 
1  -- Macro: ACCUM_TYPE_SIZE
1      A C expression for the size in bits of the type '_Accum' on the
1      target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT * 4'.
1 
1  -- Macro: LONG_ACCUM_TYPE_SIZE
1      A C expression for the size in bits of the type 'long _Accum' on
1      the target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT * 8'.
1 
1  -- Macro: LONG_LONG_ACCUM_TYPE_SIZE
1      A C expression for the size in bits of the type 'long long _Accum'
1      on the target machine.  If you don't define this, the default is
1      'BITS_PER_UNIT * 16'.
1 
1  -- Macro: LIBGCC2_GNU_PREFIX
1      This macro corresponds to the 'TARGET_LIBFUNC_GNU_PREFIX' target
1      hook and should be defined if that hook is overriden to be true.
1      It causes function names in libgcc to be changed to use a '__gnu_'
1      prefix for their name rather than the default '__'.  A port which
1      uses this macro should also arrange to use 't-gnu-prefix' in the
1      libgcc 'config.host'.
1 
1  -- Macro: WIDEST_HARDWARE_FP_SIZE
1      A C expression for the size in bits of the widest floating-point
1      format supported by the hardware.  If you define this macro, you
1      must specify a value less than or equal to the value of
1      'LONG_DOUBLE_TYPE_SIZE'.  If you do not define this macro, the
1      value of 'LONG_DOUBLE_TYPE_SIZE' is the default.
1 
1  -- Macro: DEFAULT_SIGNED_CHAR
1      An expression whose value is 1 or 0, according to whether the type
1      'char' should be signed or unsigned by default.  The user can
1      always override this default with the options '-fsigned-char' and
1      '-funsigned-char'.
1 
1  -- Target Hook: bool TARGET_DEFAULT_SHORT_ENUMS (void)
1      This target hook should return true if the compiler should give an
1      'enum' type only as many bytes as it takes to represent the range
1      of possible values of that type.  It should return false if all
1      'enum' types should be allocated like 'int'.
1 
1      The default is to return false.
1 
1  -- Macro: SIZE_TYPE
1      A C expression for a string describing the name of the data type to
1      use for size values.  The typedef name 'size_t' is defined using
1      the contents of the string.
1 
1      The string can contain more than one keyword.  If so, separate them
1      with spaces, and write first any length keyword, then 'unsigned' if
1      appropriate, and finally 'int'.  The string must exactly match one
1      of the data type names defined in the function
1      'c_common_nodes_and_builtins' in the file 'c-family/c-common.c'.
1      You may not omit 'int' or change the order--that would cause the
1      compiler to crash on startup.
1 
1      If you don't define this macro, the default is '"long unsigned
1      int"'.
1 
1  -- Macro: SIZETYPE
1      GCC defines internal types ('sizetype', 'ssizetype', 'bitsizetype'
1      and 'sbitsizetype') for expressions dealing with size.  This macro
1      is a C expression for a string describing the name of the data type
1      from which the precision of 'sizetype' is extracted.
1 
1      The string has the same restrictions as 'SIZE_TYPE' string.
1 
1      If you don't define this macro, the default is 'SIZE_TYPE'.
1 
1  -- Macro: PTRDIFF_TYPE
1      A C expression for a string describing the name of the data type to
1      use for the result of subtracting two pointers.  The typedef name
1      'ptrdiff_t' is defined using the contents of the string.  See
1      'SIZE_TYPE' above for more information.
1 
1      If you don't define this macro, the default is '"long int"'.
1 
1  -- Macro: WCHAR_TYPE
1      A C expression for a string describing the name of the data type to
1      use for wide characters.  The typedef name 'wchar_t' is defined
1      using the contents of the string.  See 'SIZE_TYPE' above for more
1      information.
1 
1      If you don't define this macro, the default is '"int"'.
1 
1  -- Macro: WCHAR_TYPE_SIZE
1      A C expression for the size in bits of the data type for wide
1      characters.  This is used in 'cpp', which cannot make use of
1      'WCHAR_TYPE'.
1 
1  -- Macro: WINT_TYPE
1      A C expression for a string describing the name of the data type to
1      use for wide characters passed to 'printf' and returned from
1      'getwc'.  The typedef name 'wint_t' is defined using the contents
1      of the string.  See 'SIZE_TYPE' above for more information.
1 
1      If you don't define this macro, the default is '"unsigned int"'.
1 
1  -- Macro: INTMAX_TYPE
1      A C expression for a string describing the name of the data type
1      that can represent any value of any standard or extended signed
1      integer type.  The typedef name 'intmax_t' is defined using the
1      contents of the string.  See 'SIZE_TYPE' above for more
1      information.
1 
1      If you don't define this macro, the default is the first of
1      '"int"', '"long int"', or '"long long int"' that has as much
1      precision as 'long long int'.
1 
1  -- Macro: UINTMAX_TYPE
1      A C expression for a string describing the name of the data type
1      that can represent any value of any standard or extended unsigned
1      integer type.  The typedef name 'uintmax_t' is defined using the
1      contents of the string.  See 'SIZE_TYPE' above for more
1      information.
1 
1      If you don't define this macro, the default is the first of
1      '"unsigned int"', '"long unsigned int"', or '"long long unsigned
1      int"' that has as much precision as 'long long unsigned int'.
1 
1  -- Macro: SIG_ATOMIC_TYPE
1  -- Macro: INT8_TYPE
1  -- Macro: INT16_TYPE
1  -- Macro: INT32_TYPE
1  -- Macro: INT64_TYPE
1  -- Macro: UINT8_TYPE
1  -- Macro: UINT16_TYPE
1  -- Macro: UINT32_TYPE
1  -- Macro: UINT64_TYPE
1  -- Macro: INT_LEAST8_TYPE
1  -- Macro: INT_LEAST16_TYPE
1  -- Macro: INT_LEAST32_TYPE
1  -- Macro: INT_LEAST64_TYPE
1  -- Macro: UINT_LEAST8_TYPE
1  -- Macro: UINT_LEAST16_TYPE
1  -- Macro: UINT_LEAST32_TYPE
1  -- Macro: UINT_LEAST64_TYPE
1  -- Macro: INT_FAST8_TYPE
1  -- Macro: INT_FAST16_TYPE
1  -- Macro: INT_FAST32_TYPE
1  -- Macro: INT_FAST64_TYPE
1  -- Macro: UINT_FAST8_TYPE
1  -- Macro: UINT_FAST16_TYPE
1  -- Macro: UINT_FAST32_TYPE
1  -- Macro: UINT_FAST64_TYPE
1  -- Macro: INTPTR_TYPE
1  -- Macro: UINTPTR_TYPE
1      C expressions for the standard types 'sig_atomic_t', 'int8_t',
1      'int16_t', 'int32_t', 'int64_t', 'uint8_t', 'uint16_t', 'uint32_t',
1      'uint64_t', 'int_least8_t', 'int_least16_t', 'int_least32_t',
1      'int_least64_t', 'uint_least8_t', 'uint_least16_t',
1      'uint_least32_t', 'uint_least64_t', 'int_fast8_t', 'int_fast16_t',
1      'int_fast32_t', 'int_fast64_t', 'uint_fast8_t', 'uint_fast16_t',
1      'uint_fast32_t', 'uint_fast64_t', 'intptr_t', and 'uintptr_t'.  See
1      'SIZE_TYPE' above for more information.
1 
1      If any of these macros evaluates to a null pointer, the
1      corresponding type is not supported; if GCC is configured to
1      provide '<stdint.h>' in such a case, the header provided may not
1      conform to C99, depending on the type in question.  The defaults
1      for all of these macros are null pointers.
1 
1  -- Macro: TARGET_PTRMEMFUNC_VBIT_LOCATION
1      The C++ compiler represents a pointer-to-member-function with a
1      struct that looks like:
1 
1             struct {
1               union {
1                 void (*fn)();
1                 ptrdiff_t vtable_index;
1               };
1               ptrdiff_t delta;
1             };
1 
1      The C++ compiler must use one bit to indicate whether the function
1      that will be called through a pointer-to-member-function is
1      virtual.  Normally, we assume that the low-order bit of a function
1      pointer must always be zero.  Then, by ensuring that the
1      vtable_index is odd, we can distinguish which variant of the union
1      is in use.  But, on some platforms function pointers can be odd,
1      and so this doesn't work.  In that case, we use the low-order bit
1      of the 'delta' field, and shift the remainder of the 'delta' field
1      to the left.
1 
1      GCC will automatically make the right selection about where to
1      store this bit using the 'FUNCTION_BOUNDARY' setting for your
1      platform.  However, some platforms such as ARM/Thumb have
1      'FUNCTION_BOUNDARY' set such that functions always start at even
1      addresses, but the lowest bit of pointers to functions indicate
1      whether the function at that address is in ARM or Thumb mode.  If
1      this is the case of your architecture, you should define this macro
1      to 'ptrmemfunc_vbit_in_delta'.
1 
1      In general, you should not have to define this macro.  On
1      architectures in which function addresses are always even,
1      according to 'FUNCTION_BOUNDARY', GCC will automatically define
1      this macro to 'ptrmemfunc_vbit_in_pfn'.
1 
1  -- Macro: TARGET_VTABLE_USES_DESCRIPTORS
1      Normally, the C++ compiler uses function pointers in vtables.  This
1      macro allows the target to change to use "function descriptors"
1      instead.  Function descriptors are found on targets for whom a
1      function pointer is actually a small data structure.  Normally the
1      data structure consists of the actual code address plus a data
1      pointer to which the function's data is relative.
1 
1      If vtables are used, the value of this macro should be the number
1      of words that the function descriptor occupies.
1 
1  -- Macro: TARGET_VTABLE_ENTRY_ALIGN
1      By default, the vtable entries are void pointers, the so the
1      alignment is the same as pointer alignment.  The value of this
1      macro specifies the alignment of the vtable entry in bits.  It
1      should be defined only when special alignment is necessary.  */
1 
1  -- Macro: TARGET_VTABLE_DATA_ENTRY_DISTANCE
1      There are a few non-descriptor entries in the vtable at offsets
1      below zero.  If these entries must be padded (say, to preserve the
1      alignment specified by 'TARGET_VTABLE_ENTRY_ALIGN'), set this to
1      the number of words in each data entry.
1