home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!mala.bc.ca!bigras
- From: bigras@mala.bc.ca
- Newsgroups: comp.os.ms-windows.programmer.win32
- Subject: Bizzare array size link errors??
- Message-ID: <1992Dec22.211411.1147@mala.bc.ca>
- Date: 22 Dec 92 21:14:11 -0700
- Organization: Malaspina College
- Lines: 57
-
- Hi,
- There seems to be a weird little bug involving large
- fixed arrays using the SDK.
-
- This does not compile and link the buff array properly.
-
- #include <stdio.h>
- int i;
- long count;
- long buff[1024*1024*4];
- main()
- {
- for (i=0; i<=1; i++)
- {
- for (count=0; count<=1024*1024*4; count++)
- buff[count]=count;
- printf ("Win32\n");
- }
- return(0);
- }
-
- When made this produces the following error:
-
- Microsoft(R) Windows NT Linker Version 2.19
- (C) 1989-1992 Microsoft Corp. All rights reserved.
-
- simple.obj() : warning 0516: _buff is undefined
-
-
- Yet the following code makes fine, the only difference is the size
- of the buff array! So why is this?
-
- #include <stdio.h>
- int i;
- long count;
- long buff[1024*1024*2];
- main()
- {
- for (i=0; i<=1; i++)
- {
- for (count=0; count<=1024*1024*2; count++)
- buff[count]=count;
- printf ("Win32\n");
- }
- return(0);
- }
-
- Various other sizes of char or int arrays exhibit similar
- bizzare errors depending on the size of the array.
-
- Any ideas?
-
- Tony Bigras
-
- BIGRAS@MALA.BC.CA
-
- ok
-