Help - Search - Members - Calendar
Full Version: Array Of Structs Compile Error?
SourceBoost support forum > PIC and SX Embedded Programming > Bug Reports
Neil

Hi

I think I have bumped into a compiler bug. I am using 6.96 pro on XP.

I have code that allocates an array of structs, similar to the following

struct foo
{
unsigned char a;
unsigned char b;
unsigned char c;
unsigned char d;
}


foo myFoo[256];

If I go above 256 then i get a comiler warning to use a switch that will be in 7.0. This makes sence to me. Cant do this yet.

If I stick to 256 It compiles, runs and has all sorts of run time errors, which apear to be memory coruption.

If I go down to 64, all is well.!


I thought that the bigest size array was limited to 1 code bank, so 256? If thi is so, the compiler should check the size of the array and the size of the object.

I susspect that a bug has crept in during 7.0 evelopment. Im sure it did not use to do this.

Comments welcome.


Neil




Dave
QUOTE (Neil @ Nov 9 2009, 07:42 PM) *
I think I have bumped into a compiler bug. I am using 6.96 pro on XP.

...I thought that the bigest size array was limited to 1 code bank, so 256? If thi is so, the compiler should check the size of the array and the size of the object.

I susspect that a bug has crept in during 7.0 evelopment. Im sure it did not use to do this.
You are indeed correct, this problem was introduced in V6.96 and needs fixing very soon.

Regards
Dave
Neil
Hi Dave

Thanks for the update

Neil
Dave
Neil,
QUOTE (Neil @ Nov 9 2009, 07:42 PM) *
I think I have bumped into a compiler bug. I am using 6.96 pro on XP.
...
This problem was indeed introduced in BoostC V6.96 and affects PIC18 targets, allowing bad code to be compiled and linked without an error or warning (nasty). It has been fixed in latest release of SourceBoost Package V6.97 Beta2 you can get from http://www.sourceboost.com/CommonDownload.html.

Regards
Dave
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.