View unanswered posts | View active topics It is currently Fri Apr 19, 2019 6:35 am

Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Slightly Big Arrays == RobotC Not Happy? 
Author Message

Joined: Fri Jan 27, 2012 6:57 pm
Posts: 40
Post 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.

Fri Feb 03, 2012 11:38 am

Joined: Fri Feb 09, 2007 9:21 am
Posts: 616
Post 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).

Sat Feb 18, 2012 10:18 am
Display posts from previous:  Sort by  
Reply to topic   [ 17 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.