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

RobotC 3.50 bug 4
http://www.robotc.net/forums/viewtopic.php?f=63&t=4840
Page 1 of 1

Author:  MHTS [ Sat Sep 15, 2012 5:37 pm ]
Post subject:  RobotC 3.50 bug 4

Here is bug #4:
Code:
typedef struct
{
    char     titleText[18];
    int      flags;
    int      numChoices;
    char     choiceTexts[16][18];
    int      choiceValues[16];
    int      currChoice;
    int      firstChoice;
    int      userChoice;
} MENU;

MENU g_menu;

void Func2(int n)
{
    nxtDisplayTextLine(0, "n=%d", n);
}

void Func1(MENU &menu)
{
    Func2((menu.currChoice - menu.firstChoice) + 1);
}

task main()
{
    g_menu.currChoice = 0;
    g_menu.firstChoice = 0;
    Func1(g_menu);
}

It gave the output:
Quote:
n=8281

It looks like this is another issue of wrong pointer indirection.

Author:  Dick Swan [ Mon Sep 17, 2012 2:51 pm ]
Post subject:  Re: RobotC 3.50 bug 4

Fixed for next release. THis was due to the broken oeprator precedence in the parser.

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