XIANGYANG LIU

one very strange problem:(:(

Discussion created by XIANGYANG LIU on Jun 15, 2008
Latest reply on Jun 16, 2008 by CrasyCat
Dear All

     I just modified my code to simplest form, and the compiler still gives error message, here is my code:

#include <stdio.h>
main(){
    short n1,n2,i,j,k;
    n2 = 16;
    for (k=16; k > 1; k = k/2 )
    {
        n1 = n2;    n2 = n2/2;   
        for (j=0; j < n2; j++)
        {
            for (i=j; i < 16; i = i + n1)
            {
            }
        }
    }

    printf("END\n");
}


Very simple code, but compiler always gives such error:


scc -g -ge -env "C:\Program Files\Freescale\CodeWarrior for StarCore 3.1\StarCore_Support\compiler"  -be  -arch sc3400 -sc -mod -Og -O3 -Xlnk "-w" -Xlnk "-n" -o "C:\Documents and Settings\victorlxy\My Documents\FreeScale Projecs\test\project.eld" "test_Data\C_for_SC_Simulator\ObjectCode\main.obj"

Link Error   : ERROR: Non-zero return status from "C:\Program Files\Freescale\CodeWarrior for StarCore 3.1\StarCore_Support\compiler\bin\icode.exe".

Tool = SCC | Error ID = 1027
Project: test.mcp, Target: C for SC Simulator

Error   : "prototype_be.obj", line -1: Error: Bad call to linear solver (build_ud_linear_combi)
 - Context: <main'_main>

Tool = ICODE | Error ID = 3401
Project: test.mcp, Target: C for SC Simulator

Link Error   : link exit status = 2
Project: test.mcp, Target: C for SC Simulator






but the stranger problem here is that I changed one variable n2 to an integer such as 2, then it will work fine...how strange it is...:smileysad:
that is I changed my code to the following

#include <stdio.h>
main(){
    short n1,n2,i,j,k;
    n2 = 16;
    for (k=16; k > 1; k = k/2 )
    {
        n1 = n2;    n2 = n2/2;   
        for (j=0; j < 2; j++)
        {
            for (i=j; i < 16; i = i + n1)
            {
            }
        }
    }

    printf("END\n");
}

just changed the n2 to "2" in the red "2" place

then this code will run with no such above error message....

anyone knows how to deal with this problem ,  is this the complier problem ?? since I just could not find any error in my code


Best Regards

thank you all in advance

Outcomes