C3400: Cannot initialize object (destination too small)

[ERROR]

Description

An object cannot been initialized, because the destination is too small, e.g. because the pointer is too small to hold the address. The message typically occurs if the programmer tries to initialize a near pointer (e.g. 16bit) with a far pointer (e.g. 24bit).

Example
  #pragma DATA_SEG FAR MyFarSegment

  
  char Array[10];

  
  #pragma DATA_SEG DEFAULT

  
  char *p = Array;

  
Tips

Increase the type size for the destination (e.g. with using the far keyword if supported)

  char *far p = Array;

  
See also