RobotC and Programming NXT

From Jack Kelly:

To cut a long story short: we believe that we keep hitting up against bugs in the RobotC compiler. There are problems which are trivial to work around (like it appears it's best to avoid using #define and enum) and there some problems which are a serious headache, for example:

RobotC seems to produce code which crashes the robot if you pass a struct reference to a function which in turn passes the same struct to a second function, even though RobotC produces no errors at compile-time (for example, we're using a struct to store the robot's {x,y & orientation} and this struct gets passed by reference to an update_state function which, in turn, passes the struct by reference to an update_orientation function).

Sometimes two bits of code which work perfectly well in isolation will crash the robot when used together (even though there are no compile-time errors).

No pointers in RobotC

Also:

I've been browsing the robotc.net forums and it looks like there definitely is a serious bug in the compiler concerning passing structs by reference: RobotC bug concerning structures.

Andrew Davison