IPB

Welcome Guest ( Log In | Register )

> Array Of Structs Compile Error?
Neil
post Nov 9 2009, 07:42 PM
Post #1


Regular
*

Group: EstablishedMember
Posts: 26
Joined: 3-July 08
Member No.: 4,248




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




update SourceBoost release 6.97 is available.
Download Now
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
Dave
post Nov 16 2009, 08:32 PM
Post #2


Super Maniac
*****

Group: Administrators
Posts: 1,830
Joined: 28-September 04
From: UK
Member No.: 469



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
Go to the top of the page
 
+Quote Post

Posts in this topic
- Neil   Array Of Structs Compile Error?   Nov 9 2009, 07:42 PM
- - Dave   QUOTE (Neil @ Nov 9 2009, 07:42 PM) I thi...   Nov 10 2009, 12:45 PM
|- - Neil   Hi Dave Thanks for the update Neil   Nov 10 2009, 01:14 PM
- - Dave   Neil, QUOTE (Neil @ Nov 9 2009, 07:42 PM)...   Nov 16 2009, 08:32 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 3rd September 2010 - 03:01 PM