RobotC Function Limit

While preparing for worlds this year, we encountered a rather annoying problem with what appears to be a 256 function limit in RobotC. While this in itself is an understandable limitation, (though I would love another byte to be dedicated to function references as that would hopefully prevent this from ever recurring) after some time spent scratching our heads and counting functions, we determined that we had nowhere near 256 functions, only about half of that. Using the compiler statistics feature in RobotC, we found that all of our functions were counting twice towards this limit. After some more experimentation, we realized that all function declarations were counting towards this limit along with the definitions. I suspect this is a bug and somewhere a counter is being accidentally incremented or a line in a table not being overwritten as I don’t see why the declaration and definition should be any different at the VM level. As we like to declare all our functions in header files as it makes for a nice reference and cleaner code, any more insight into this problem would be wonderful.

Thanks for your time,


Thanks for the feedback, that does sound like a bug and it’s pretty easy to reproduce. I do notice that even though the compiler statistics show twice as many procedures the compiler is only allocating one slot for each one. There may be time to fix this before we release V4.56, I will let you know.


Bug found. Bug fixed. Hopefully we can get into V4.56 which will be released in the next couple of weeks.