| |||||
Technical Support Support Resources
Product Information | C166: PUTTING INITIALIZED VARIABLES IN XDATAInformation in this article applies to:
SYMPTOMSI have a very large program with many large, initialized variables. When I build my project, I receive one of the following error messages: *** ERROR 172 IN LINE 9 OF test.c: 'HDATA0': length exceeded: act=172032, max=65536 Error 106: Section Overflow Section: ?C_INITSEC CAUSEThis error occurs because the section used to initialize global variables is overflowing. The following example program demonstrates this error.
int big_array1 [0x7000] = { 1, 2, 3, 4, };
int big_array2 [0x7000] = { 1, 2, 3, 4, };
int big_array3 [0x7000] = { 1, 2, 3, 4, };
void main (void)
{
}
RESOLUTIONThe best solution is to place some of your variables in XDATA by using the XHUGE memory type when you declare the variable. For example:
int xhuge big_array1 [0x7000] = { 1, 2, 3, 4, };
int xhuge big_array2 [0x7000] = { 1, 2, 3, 4, };
int xhuge big_array3 [0x7000] = { 1, 2, 3, 4, };
void main (void)
{
}
MORE INFORMATION
SEE ALSOLast Reviewed: Friday, July 15, 2005 | ||||
| |||||