This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: size of array "" is too large


Hariharan wrote:
[...] in a 16-bit target (picochip), you cannot define,

struct trial
{
  long a[10000];
};

In the case above, i get a
"size of array ‘a’ is too large" error.

The thing that took me by surprise was, if i split the structure to

struct trial
{
  long a[5000];
  long b[5000];
};

This works fine.
If your "long" is 32-bit, then your first array covers more memory than the range of a signed 16-bit integer, whereas the second set of arrays doesn't hit this limitation. Perhaps the limitation is forced on GCC by the limitations of your target.

Cheers,
Nicholas Sherlock


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]