I have a project (RCM4200) which hangs the Dynamic C IDE depending on the declared size of an array which lives in a LIB file. Here is a simplified project which demonstrates this:
/*** BeginHeader */
#ifndef __DBSSSTATE_LIB
#define __DBSSSTATE_LIB
/*** EndHeader */
/*** BeginHeader */
typedef struct MapBxxx1
{
unsigned short SyncCode[34];
} MapBxxx1_t;
/*** EndHeader */
/*** BeginHeader MapBxxx1, MapBxxx1_0, MapBxxx1_1, MapBxxx1_2, MapBxxx1_3 */
extern MapBxxx1_t MapBxxx1[4];
extern MapBxxx1_t MapBxxx1_0;
extern MapBxxx1_t MapBxxx1_1;
extern MapBxxx1_t MapBxxx1_2;
extern MapBxxx1_t MapBxxx1_3;
/*** EndHeader */
MapBxxx1_t MapBxxx1[4];
MapBxxx1_t MapBxxx1_0;
MapBxxx1_t MapBxxx1_1;
MapBxxx1_t MapBxxx1_2;
MapBxxx1_t MapBxxx1_3;
/*** BeginHeader */
#endif
/*** EndHeader */
and the main c file:
#class auto
#use RCM42xx.LIB
#use DBSSStuff.LIB
MapBxxx1_t LOCALMapBxxx1[4];
void main()
{
// Do any initialisation required
brdInit();
// FAIL ----- Can't touch item 3!!
MapBxxx1[3].SyncCode[0] = 3;
MapBxxx1[2].SyncCode[0] = 2;
MapBxxx1[1].SyncCode[0] = 1;
LOCALMapBxxx1[3].SyncCode[0] = 3;
LOCALMapBxxx1[2].SyncCode[0] = 2;
LOCALMapBxxx1[1].SyncCode[0] = 1;
MapBxxx1_3.SyncCode[0] = 3;
MapBxxx1_2.SyncCode[0] = 2;
MapBxxx1_1.SyncCode[0] = 1;
printf("Done!");
}
Commenting out the line below the fail marker makes the project run. With the line uncommented the IDE hangs and times out.
As you can see a locally declared array works but one in a library fails.
This also seems to depend on the size of the record: anything over 66 bytes fails.
Is there a documented (or undocumented) limitation on external array sizes? Am I doing something wrong in my LIB file?
Thanks
Dave