Jump to content
Neil

Array Of Structs Compile Error?

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Neil,

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

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...