ROBOTC.net forums
http://www.robotc.net/forums/

RobotC 3.51 bug 9
http://www.robotc.net/forums/viewtopic.php?f=63&t=4910
Page 1 of 1

Author:  MHTS [ Thu Sep 27, 2012 4:47 am ]
Post subject:  RobotC 3.51 bug 9

Got a warning when compiling the following code. The code gave me the correct answer though.
*Warning*:Substituting 'opcdAssign' opcode for 'opcdAssignRamVariablePtr'
Code:
typedef struct
{
    int n1;
    int n2;
} OBJ1;

typedef struct
{
    OBJ1 *obj1;
    int n3;
} OBJ2;

OBJ1 g_obj1;
OBJ2 g_obj2;

void InitObj1(OBJ1 &obj1)
{
    obj1.n1 = 1;
    obj1.n2 = 2;
}

void InitObj2(OBJ2 &obj2, OBJ1 &obj1, int n)
{
    obj2.obj1 = &obj1;
    obj2.n3 = n;
}

void Func1(OBJ1 &obj1)
{
    nxtDisplayTextLine(0, "obj1.n1=%d", obj1.n1);
    nxtDisplayTextLine(1, "obj1.n2=%d", obj1.n2);
}

void Func2(OBJ2 &obj2)
{
    Func1(*obj2.obj1);
    nxtDisplayTextLine(2, "obj2.n3=%d", obj2.n3);
}

task main()
{
    InitObj1(g_obj1);
    InitObj2(g_obj2, g_obj1, 3);

    Func2(g_obj2);
}

Author:  Dick Swan [ Tue Oct 02, 2012 2:25 am ]
Post subject:  Re: RobotC 3.51 bug 9

This warning message has been removed. It was primarily a benign message created during compiler development to validate that optimized code was being created. The update was to go back to calling routine and add the additional 3-line check to create optimized code.

Author:  Dick Swan [ Tue Oct 02, 2012 2:25 am ]
Post subject:  Re: RobotC 3.51 bug 9

This warning message has been removed. It was primarily a benign message created during compiler development to validate that optimized code was being created. The update was to go back to calling routine and add the additional 3-line check to create optimized code.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/