delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/05/13:30:28

From: wagray AT taz DOT dra DOT hmg DOT gb (Walter Gray)
Newsgroups: comp.os.msdos.djgpp
Subject: array index problem
Date: 5 Jun 1998 17:13:16 GMT
Organization: Defence Research Agency
Message-ID: <6l98vc$k3a$5@trog.dra.hmg.gb>
Reply-To: wagray AT taz DOT dra DOT hmg DOT gb
NNTP-Posting-Host: taz.dra.hmg.gb
Lines: 24
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi

Having just started with djgpp (C only) I thought I'd try a test
with a big 1-dimensional (long) array. Just simple stuff- initialise
in the first loop, accumulate (to double) in the second loop, print 
the sum. The program works fine with gcc on a Sun, but on my old 386
I get a General Protection Fault if the array size is over about
65500  (NB, I do not mean 2^16, I mean about 65500).

For some values the program works ok and crashes on exit. For
larger values it just crashes. Have I hit some sort of limit on
array index values? I found nothing relevant in Info, though one
can never be sure with that system :)


Any thoughts?     (CWSDPMI and 600KB+3MB RAM free)


Apart from that, all goes well...


Walter

Disclaimer: My employer is not responsible for this stuff.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019