ID: Q116372
1.00 1.50 WINDOWS kbprg kbbuglist kberrmsg
The information in this article applies to:
When you build a project containing an initialized huge array, the linker generates this error message:
L1103: TEST5_DATA : attempt to access data outside segment bounds
TEST is the name of the source file where the initialization occurred.
To work around this problem:
-or-
-or-
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information in the Microsoft Knowledge Base as it becomes available.
This problem occurs only if an element that is near the 64K boundary of the array is initialized. In the sample code below, initializing the member "a[0].b" causes the error to occur:
*\
The following code sample does reproduce the problem.
// TEST1.C
struct test {
int a[32767];
char b;
};
struct test _huge a[2] = {{{1,2,3},{'a'}}, {{11,12,13},{'b'}}};
void main() {}
The following code samples do not reproduce the problem:
// TEST2.C
int x[32767] = {1,2,3};
int y[32767] = {11,12,13};
struct test {
int *a;
char b;
};
struct test _huge a[2] = {{x,'a'}, {y,'b'}};
void main() {}
// TEST3.C
struct test {
int a[32767];
char b;
};
struct test _huge a[2] = {0}; //Initialization prevents L1072 error
void main() {
a[0].a[0] = 1;
a[0].a[1] = 2;
a[0].a[2] = 3;
a[0].b = 'a';
a[1].a[0] = 11;
a[1].a[1] = 12;
a[1].a[2] = 13;
a[1].b = 'b';
}
Additional reference words: 1.00 1.50 7.00 8.00 8.00c memory model initialize KBCategory: kbprg kbbuglist kberrmsg KBSubCategory: CLIss Keywords : kb16bitonly
Last Reviewed: July 23, 1997