Primitive Types

December 12, 2025 ยท View on GitHub

CodeView defines a set of primitive types. Primitive types have specified meanings and do not require type records within a PDB to define the primitive type. For example, the C/C++ types void, unsigned int, and char are primitive types.

Primitive types are identified by TypeIndex values that are less than the type_index_begin value defined in the TPI Stream Header. type_index_begin is required to be at least 4096, so all TypeIndex values that are less than 4096 are primitive types.

The TypeIndex value for primitive types is composed of the following bit fields. Because primitive types are in the reserved range of 0-4095, the TypeIndex value has 12 significant bits.

FieldBitsDescription
size0-2Specifies the size of the primitive; see below.
(reserved)3Reserved; always zero.
type4-7Specifies the type of the primitive; see below.
mode8-10Specifies the mode of the primitive; see below.
(reserved)11Reserved; always zero.

The type field can take on these values:

type valuetype nameUsage
0x00TY_SPECIALSpecial
0x01TY_SINTSigned integer
0x02TY_UINTUnsigned integer
0x03TY_BOOLEANBoolean
0x04TY_REALReal (floating-point)
0x05TY_COMPLEXComplex
0x06TY_SPECIAL2Special2
0x07TY_REALLYINT"Really" int value
0x08 - 0x0fReserved

The interpretation of the size field depends on the type field. It can taken on these values:

size valueTY_SPECIAL usageTY_SINT, TY_UINT,
TY_BOOLEAN usage
TY_REALLYINTTY_REAL and
TY_COMPLEX usage
TY_SPECIAL2 usage
0No type1 bytechar32-bitbit
1absolute symbol2 byteswchar_t64-bitPascal CHAR
2segment4 bytesint16_t80-bitreserved
3C/C++ void type8 bytesuint16_t128-bitreserved
4obsoletereservedint32_t48-bitreserved
5obsoletereserveduint32_treservedreserved
6obsoletereservedint64_treservedreserved
7obsoletereserveduint64_treservedreserved

The mode field specifies the pointer mode for pointer types. It can take on thse values:

mode valuemode nameUsage
0MODE_DIRECTDirect value; not a pointer
1MODE_NEARNear pointer
2MODE_FARFar pointer
3MODE_HUGEHuge pointer
4MODE_NEAR3232-bit near pointer
5MODE_FAR3232-bit far pointer
6MODE_NEAR6464-bit near pointer

The distinctions between "near", "far", and "huge" pointers date back to segmented 80x86 CPU architectures. They are no longer relevant, since modern systems always use flat memory models. For 32-bit architectures (x86, ARM32), mode is MODE_NEAR32. For 64-bit architectures (AMD64, ARM64), mode is MODE_NEAR64.

CodeView defines types for segmented architectures (such as 8086), which are obsolete. This specification omits these obsolete variants.

TODO: actually delete obsolete variants from the lists below

C/C++ types and explicitly-sized ("really") types

C/C++ defines a family of integer types, such as int, short int, long int, long long int, and their unsigned variants. The C/C++ language specification does not mandate a specific bit size for each type. Instead, the C/C++ specification defines that the bit size (and therefore range) of int is equal to or greater than that of short int, and that long int is equal to or greater than that of int, and similar for long long int.

MSVC uses specific bit sizes for these types, but MSVC also defines a separate set of integer types which have explicit sizes. These are separate types, even if they are trivially convertible between the C/C++ types of the same bit size. These explicitly-sized types are the "really" types. In C/C++ source code, they are identified by __int8, __int32, unsigned __int64, etc.

Types summary

Most types also have a 32-bit pointer type and a 64-bit pointer type. There are many obsolete types that are not shown in this table.

Most compilers, such as the MSVC C/C++ compiler, MASM, and Rust, can generate only a subset of the types in this table.

NameValue32-bit
Pointer Name
Value64-bit
Pointer Name
ValueSize
(bytes)
C/C++ TypeDescription
T_NOTYPE0x0000Uncharacterized type
T_ABS0x0001Absolute symbol
T_SEGMENT0x0002Segment type (obsolete)
T_VOID0x0003T_32PVOID0x0403T_64PVOID0x0603voidThe C/C++ void type
T_CHAR0x0010T_32PCHAR0x0410T_64PCHAR0x06101char8-bit signed
T_QUAD0x0013T_32PQUAD0x0413T_64PQUAD0x06138long long64-bit signed
T_SHORT0x0011T_32PSHORT0x0411T_64PSHORT0x06112short16-bit signed
T_LONG0x0012T_32PLONG0x0412T_64PLONG0x06124long32-bit signed
T_UCHAR0x0020T_32PUCHAR0x0420T_64PUCHAR0x06201unsigned char8-bit unsigned
T_USHORT0x0021T_32PUSHORT0x0421T_64PUSHORT0x06212unsigned short16-bit unsigned
T_ULONG0x0022T_32PULONG0x0422T_64PULONG0x06224unsigned long32-bit unsigned
T_UQUAD0x0023T_32PUQUAD0x0423T_64PUQUAD0x06238unsigned long long64-bit unsigned
T_BOOL080x0030T_32PBOOL080x0430T_64PBOOL080x06301bool8-bit Boolean value
T_BOOL160x0031T_32PBOOL160x0431T_64PBOOL160x0631216-bit Boolean value
T_BOOL320x0032T_32PBOOL320x0432T_64PBOOL320x0632432-bit Boolean value
T_BOOL640x0033T_32PBOOL640x0433T_64PBOOL640x0633864-bit Boolean value
T_RCHAR0x0070T_32PRCHAR0x0470T_64PRCHAR0x0670real char: is this __int8?
T_WCHAR0x0071T_32PWCHAR0x0471T_64PWCHAR0x06712wchar_twide char
T_INT20x0072T_32PINT20x0472T_64PINT20x06722__int1616 bit signed int
T_UINT20x0073T_32PUINT20x0473T_64PUINT20x06732unsigned __int1616 bit unsigned int
T_INT40x0074T_32PINT40x0474T_64PINT40x06744__int32really 32 bit signed int
T_UINT40x0075T_32PUINT40x0475T_64PUINT40x06754unsigned __int32really 32 bit unsigned int
T_INT80x0076T_32PINT80x0476T_64PINT80x06768__int6464-bit signed int
T_UINT80x0077T_32PUINT80x0477T_64PUINT80x06778unsigned __int6464-bit unsigned int
T_REAL320x0040T_32PREAL320x0440T_64PREAL320x06404float32-bit real
T_REAL480x0044T_32PREAL480x0444T_64PREAL480x0644648-bit real
T_REAL640x0041T_32PREAL640x0441T_64PREAL640x06418double64-bit real
T_REAL800x0042T_32PREAL800x0442T_64PREAL800x06421080-bit real
T_REAL1280x0043T_32PREAL1280x0443T_64PREAL1280x064316128-bit real
T_CPLX320x0050T_32PCPLX320x0450T_64PCPLX320x0650832-bit complex
T_CPLX640x0051T_32PCPLX640x0451T_64PCPLX640x06511664-bit complex
T_CPLX800x0052T_32PCPLX800x0452T_64PCPLX800x06522080-bit complex
T_CPLX1280x0053T_32PCPLX1280x0453T_64PCPLX1280x065332128-bit complex

Special types

NameValueC/C++ TypeDescription
T_NOTYPE0x0000Uncharacterized type (no type)
T_ABS0x0001Absolute symbol
T_SEGMENT0x0002Segment type (obsolete)
T_VOID0x0003voidThe C/C++ void type
T_32PVOID0x0403void *32 bit near pointer to void
T_64PVOID0x0603void *64-bit pointer to void

Character types

NameValueC/C++ TypeDescription
T_CHAR0x00108-bit signed
T_UCHAR0x00208-bit unsigned
T_32PCHAR0x041032-bit pointer to 8-bit signed
T_32PUCHAR0x042032-bit pointer to 8-bit unsigned
T_64PCHAR0x061064-bit pointer to 8 bit signed
T_64PUCHAR0x062064-bit pointer to 8 bit unsigned

Really a character types

NameValueC/C++ TypeDescription
T_RCHAR0x0070real char
T_32PRCHAR0x047032-bit pointer to a real char
T_64PRCHAR0x067064-bit pointer to a real char

Wide character types

NameValueC/C++ TypeDescription
T_WCHAR0x0071wchar_twide char
T_32PWCHAR0x0471wchar_t *32-bit pointer to a wide char
T_64PWCHAR0x0671wchar_t *64-bit pointer to a wide char

Really 16 bit integer types

NameValueC/C++ TypeDescription
T_INT20x0072__int1616 bit signed int
T_UINT20x0073unsigned __int1616 bit unsigned int
T_32PINT20x0472__int16 *near pointer to 16 bit signed int
T_32PUINT20x0473unsigned __int16 *near pointer to 16 bit unsigned int
T_64PINT20x0672__int16 *64-bit pointer to 16 bit signed int
T_64PUINT20x0673unsigned __int16 *64-bit pointer to 16 bit unsigned int

16-bit short types

NameValueC/C++ TypeDescription
T_SHORT0x0011short16-bit signed
T_USHORT0x0021unsigned short16-bit unsigned
T_32PSHORT0x0411short *32-bit pointer to 16 bit signed
T_32PUSHORT0x0421unsigned short *32-bit pointer to 16 bit unsigned
T_64PSHORT0x0611short *64-bit pointer to 16 bit signed
T_64PUSHORT0x0621unsigned short *64-bit pointer to 16 bit unsigned

Really 32 bit integer types

NameValueC/C++ TypeDescription
T_INT40x0074really 32 bit signed int
T_UINT40x0075really 32 bit unsigned int
T_32PINT40x047432-bit pointer to 32 bit signed int
T_32PUINT40x047532-bit pointer to 32 bit unsigned int
T_64PINT40x067464-bit pointer to 32 bit signed int
T_64PUINT40x067564-bit pointer to 32 bit unsigned int

32-bit long types

NameValueC/C++ TypeDescription
T_LONG0x001232-bit signed
T_ULONG0x002232-bit unsigned
T_32PLONG0x041232-bit pointer to 32 bit signed
T_32PULONG0x042232-bit pointer to 32 bit unsigned
T_64PLONG0x061264-bit pointer to 32 bit signed
T_64PULONG0x062264-bit pointer to 32 bit unsigned

Really 64-bit integer types

NameValueC/C++ TypeDescription
T_INT80x007664-bit signed int
T_UINT80x007764-bit unsigned int
T_32PINT80x047632-bit pointer to 64 bit signed int
T_32PUINT80x047732-bit pointer to 64 bit unsigned int
T_64PINT80x067664-bit pointer to 64 bit signed int
T_64PUINT80x067764-bit pointer to 64 bit unsigned int

64-bit integral types

NameValueC/C++ TypeDescription
T_QUAD0x001364-bit signed
T_UQUAD0x002364-bit unsigned
T_32PQUAD0x041332-bit pointer to 64 bit signed
T_32PUQUAD0x042332-bit pointer to 64 bit unsigned
T_64PQUAD0x061364-bit pointer to 64 bit signed
T_64PUQUAD0x062364-bit pointer to 64 bit unsigned

32-bit real types

NameValueC/C++ TypeDescription
T_REAL320x0040float32-bit real
T_32PREAL320x0440float *32-bit pointer to 32 bit real
T_64PREAL320x0640float *64 pointer to 32 bit real

48-bit real types

NameValueC/C++ TypeDescription
T_REAL480x004448-bit real
T_32PREAL480x044432-bit pointer to 48 bit real
T_64PREAL480x064464-bit pointer to 48 bit real

64-bit real types

NameValueC/C++ TypeDescription
T_REAL640x004164-bit real
T_32PREAL640x044132-bit pointer to 64 bit real
T_64PREAL640x064164-bit pointer to 64 bit real

80-bit real types

NameValueC/C++ TypeDescription
T_REAL800x004280-bit real
T_32PREAL800x044232-bit pointer to 80 bit real
T_64PREAL800x064264-bit pointer to 80 bit real

128-bit real types

NameValueC/C++ TypeDescription
T_REAL1280x0043128-bit real
T_32PREAL1280x044332-bit pointer to 128 bit real
T_64PREAL1280x064364-bit pointer to 128 bit real

32-bit complex types

NameValueC/C++ TypeDescription
T_CPLX320x005032-bit complex
T_32PCPLX320x045032-bit pointer to 32 bit complex
T_64PCPLX320x065064-bit pointer to 32 bit complex

64-bit complex types

NameValueC/C++ TypeDescription
T_CPLX640x005164-bit complex
T_32PCPLX640x045132-bit pointer to 64 bit complex
T_64PCPLX640x065164-bit pointer to 64 bit complex

80-bit complex types

NameValueC/C++ TypeDescription
T_CPLX800x005280-bit complex
T_32PCPLX800x045232-bit pointer to 80 bit complex
T_64PCPLX800x065264-bit pointer to 80 bit complex

128-bit complex types

NameValueC/C++ TypeDescription
T_CPLX1280x0053128-bit complex
T_32PCPLX1280x045332-bit pointer to 128 bit complex
T_64PCPLX1280x065364-bit pointer to 128 bit complex

Boolean types

NameValueC/C++ TypeDescription
T_BOOL080x00308-bit boolean
T_BOOL160x003116-bit boolean
T_BOOL320x003232-bit boolean
T_BOOL640x003364-bit boolean
T_32PBOOL080x043032-bit pointer to 8 bit boolean
T_32PBOOL160x043132-bit pointer to 16 bit boolean
T_32PBOOL320x043232-bit pointer to 32 bit boolean
T_32PBOOL640x043332-bit pointer to 64-bit boolean
T_64PBOOL080x063064-bit pointer to 8 bit boolean
T_64PBOOL160x063164-bit pointer to 16 bit boolean
T_64PBOOL320x063264-bit pointer to 32 bit boolean
T_64PBOOL640x063364-bit pointer to 64-bit boolean