This is really odd. I'm getting a stackoverflow error when uploading my sketch:
java.lang.StackOverflowError
at java.util.Vector.addElement(Unknown Source)
at java.util.Stack.push(Unknown Source)
at com.oroinc.text.regex.Perl5Matcher._pushState(Perl5Matcher.java)
My sketch has the following:
void sendFrame(bool data, const char *charPtr, bool nullTerm) {
if (nullTerm) {
// special handling for commands that end with null terminator. the write command will not write the term char so we must write it explicitely
But when I change remove " we must write it explicitely" from the end of the comment, it works
This is a bug in the Arduino IDE since that is a legal assignment. What's weird is that the program worked up until it got to a certain size. In this case my comment triggered some condition.
Since comments are ignored by the compiler, it's difficult to believe that they are the cause of the problem.
The assignment of " (an escaped double quote) may be a legal assignment, but what value is actually placed in x?
It's likely that the invalid value in x was causing problems that didn't show up until x got put in a memory location that some code is overwriting, due to writing out-of-bounds, or mis-reading (again due to an out-of-bounds situation).
To clarify, the error occurred when I hit the "upload" button, not when it was uploading, because it never got that far. That stacktrace indicates a java error in the IDE. Possibly in the oroinc library. Again, it didn't get to the compilation step.
As I modified the program, it got to a point where I could prevent the error if I removed an arbitrary chunk of code, but unfortunately I needed that code.
Sorry about that. The IDE includes some relatively hacky code to preprocess your source code to add function prototypes. It's just a bunch of regular expressions that can get confused by certain unusual strings in your code (including within comments).