Errors:range error for small data relocation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Errors:range error for small data relocation

612 Views
khadgaryu
Contributor II

        I create a project for MPC5645S by code warrior 10.6.The accessory is sources of the project.Code warrior shows errors(the picture) when compiling.

        I suspect that this error is related to this structure.But I am not sure.

        Does anyone ever encounter this problem,Thanks!

        typedef struct
        {
           unsigned char Count;
           LabelMapping Mappings[];
        }LabelMappings;

       Code warrior 10.6 shows a error of range error for small data relocation,when i used the struct(LabelMappings, show above) in my project. There is a indefinite lengh array that support by C99 in the struct. And the code warrior supports C99. But there is a error when commpiling.

       There are two necessary conditions that lead to this error.One is the flexible array in the struct,the other I define varible ina file and refer the varible in another file.But I can't edit the files in my project.
       If i set the sdata and sdata2 to 0, I can compile the project successfully.But when sdata and sdata2 is 0,my project can;t run into main().My test result,if sdata = 0 and sdata2 = 0,project can run in debug mode, and can't run in noemal mode.

       I updata the new attachments,it is a whole project and can be open by code warrior 10.6.

 

174596_174596.JPGerror.JPG

Original Attachment has been moved to: MPC5645S_TEST.rar

Labels (1)
0 Kudos
1 Reply

420 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

I posted the answer in this thread https://community.nxp.com/thread/442930 

Regards,

Martin

0 Kudos