home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / mswindo / programm / win32 / 2577 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.4 KB  |  67 lines

  1. Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!mala.bc.ca!bigras
  2. From: bigras@mala.bc.ca
  3. Newsgroups: comp.os.ms-windows.programmer.win32
  4. Subject: Bizzare array size link errors??
  5. Message-ID: <1992Dec22.211411.1147@mala.bc.ca>
  6. Date: 22 Dec 92 21:14:11 -0700
  7. Organization: Malaspina College
  8. Lines: 57
  9.  
  10. Hi,
  11. There seems to be a weird little bug involving large
  12. fixed arrays using the SDK.
  13.  
  14. This does not compile and link the buff array properly.
  15.  
  16.  #include <stdio.h>
  17.  int i;  
  18.  long count;
  19.  long buff[1024*1024*4];                         
  20.  main()
  21.  {
  22.  for (i=0; i<=1; i++)
  23.   {
  24.   for (count=0; count<=1024*1024*4; count++)
  25.     buff[count]=count;
  26.   printf ("Win32\n");
  27.   }
  28.  return(0);     
  29.  }
  30.  
  31. When made this produces the following error:
  32.  
  33.  Microsoft(R) Windows NT Linker Version 2.19        
  34.  (C) 1989-1992 Microsoft Corp. All rights reserved. 
  35.                                                    
  36.  simple.obj() : warning 0516: _buff is undefined    
  37.  
  38.  
  39. Yet the following code makes fine, the only difference is the size
  40. of the buff array!  So why is this? 
  41.  
  42.  #include <stdio.h>
  43.  int i;  
  44.  long count;
  45.  long buff[1024*1024*2];                         
  46.  main()
  47.  {
  48.  for (i=0; i<=1; i++)
  49.   {
  50.   for (count=0; count<=1024*1024*2; count++)
  51.     buff[count]=count;
  52.   printf ("Win32\n");
  53.   }
  54.  return(0);     
  55.  }
  56.  
  57. Various other sizes of char or int arrays exhibit similar
  58. bizzare errors depending on the size of the array.
  59.  
  60. Any ideas?
  61.  
  62. Tony Bigras
  63.  
  64.    BIGRAS@MALA.BC.CA 
  65.  
  66. ok 
  67.