www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/04/21:24:25

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199607050117.AA231589437@relay1.geis.com>
Date: Fri, 5 Jul 96 00:46:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Re: [Q] Length of static array

Reply to message 2392847    from DMICOLET AT U-BO on 07/04/96  9:42AM


>It compiles fine, but does not link : I got the folowing :
>e:/miko/trash/essai.o : could not read symbols : Bad value.
>
>If I reduce the size of the array to 1024*1024*15, the linking is OK.
>So my question : is there a maximum length for a static array ?
>Curiously my computer has 16 M of memory : is there a connexion ?

This is a known bug in ld; it can't compile static arrays that are larger
than a certain value.  I thought it was 4 MB, but your example seems
to indicate otherwise.  You're welcome to attempt to fix ld yourself if
you like, or wait for the next DJGPP release.  :)

In the meantime, you can always impress your friend with something like
this:

int main( void )
{
    char *Mega;

    if ( ( Mega = (char *) malloc( 1024*1024*64 ) ) != NULL )
        printf( "Allocated 64MB for Mega.\n" );
    return 0;
}

Just make sure you have lots of free disk space (50 MB or so) before trying it.
 ;)

John

- Raw text -


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