This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc_increase_max_array_size
- From: Michael Eager <eager at eagercon dot com>
- To: Rolf Norrestam <rolf dot norrestam at telia dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 24 Apr 2007 10:36:28 -0700
- Subject: Re: gcc_increase_max_array_size
- References: <462E48FE.7020503@telia.com>
Rolf Norrestam wrote:
Hello 070424
With a rather standard installation of fedora 6 it appears that when
using gcc the maximum size of a c array is 524288. Is there any simple
way (as changing any conf file) to increase that array size limitation
by a factor of say 4, without having to substantially rewrite the c code?
Gcc doesn't have a size limit for arrays. But you may be
exceeding the size limit for the stack.
You may want to use dynamic allocation:
object * array = malloc (sizeof(object) * count);
instead of allocating on the stack.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077