This is the mail archive of the
mailing list for the GCC project.
Re: Variable too large
There are places in the front-end that attempt to return -1 to
indicate an invalid or
unknown size. (e.g., they assume a ssize_t, not size_t).
This of course presently causes some compiler crashes when it
attempts to allocate a 4GB
object - so clearly the API is less than satisfactory as it currently
is implemented :-)
At 10:37 AM -0400 5/2/02, Paul Koning wrote:
> >>>>> "Dan" == D Towner <email@example.com> writes:
> Dan> Hi all, I am writing a port of gcc for a 16-bit DSP. I have been
> Dan> trying to create struct's which are 32K+ bytes in size, but keep
> Dan> getting the error that they are too large. Having rooted around
> Dan> in the code, I see that a variable cannot have a size greater
> Dan> than 2^15 bytes (for a 16-bit machine). Why is there such a
> Dan> restriction? I can't find any mention of such a limit in the
> Dan> standard documents. Why is the limit not 2^16 bytes?
>I see the same error with the PDP11 target.
>This seems wrong. Clearly the target can deal with data structures up
>to 2^16 bytes, so long as the coder is careful to treat addresses and
>offsets as unsigned. That's a habit that has been pounded into the
>skulls of anyone who works on platforms like that...
Quality Software Management
Software Process Improvement / Management Consulting
Language Design / Compiler Implementation