Slightly Big Arrays == RobotC Not Happy?
Page 2 of 2

Author:  sumasmreq [ Fri Feb 03, 2012 11:38 am ]
Post subject:  Re: Slightly Big Arrays == RobotC Not Happy?

Ok, and thanks!
And to answer your response before, yes I see the difference between static (global) and dynamically allocated (local) arrays. We are using a global static array in our main code, very similar to the code in the Struct Array RedFish/BlueFish example I gave above.
So, I thought all of the arrays in ROBOTC were pre-allocated though, because there are no pointers, or heaps, or malloc, or anything like that. If not, how would do they work? Can you then make a dynamically allocated array during run-time with an non-compile-time-defined number of indices? E.G.
task main()
  int x = 1;
  int MyArray[x];

I tried, and got a "**Severe*:Constant Expression Expected" error.

Author:  Dick Swan [ Sat Feb 18, 2012 10:18 am ]
Post subject:  Re: Slightly Big Arrays == RobotC Not Happy?

miki wrote:
The previous post of this topic is invisible for days.
This post is just a test in order to see if the forum will unlock this situation.

EDIT: so the previous post seems definitely invisible, but the topic is unlocked :-) .

I don't have any problems reviewing all previous posts in this topic. Your post is #16.

A topic is displayed with 15 posts per page. Possibly there's something funny that happens in the forum software application when there are exactly 15 posts?

But just to repeat the conent of my previous post on the resolution.
Dick Swan wrote:
There was a bug in the ROBOTC firmware which I have just fixed for the next release. There was a mismatch between the total size of available user variable space that the firmware thought was used versus the size that ROBOTC IDE thought. This was corrected.The end result was that when firmware was zeroing user variables, the variables at high addresses were not being zeroed. There may also have been other side effects of this under-sized array that I did not explore.Here's a test program that checks the array is properly initialized. It uses the "Debug Stream" output window of the Debugger (use Advanced or Super User menu level to make it visible).

Page 2 of 2 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group