Touchboard error I don't understand

When verifying this Bareconductive Touch board Sketch I get this in red,
I'm not sure what that means.... IF anyone has any tip thank you!

/Users/giorgio/Documents/Arduino/libraries/MPR121/MPR121_Datastream.cpp: In member function 'void MPR121_Datastream_type::processSerial()':
/Users/giorgio/Documents/Arduino/libraries/MPR121/MPR121_Datastream.cpp:135:54: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char command = splitString(receivedChars, ":", 0);
^
/Users/giorgio/Documents/Arduino/libraries/MPR121/MPR121_Datastream.cpp:136:62: warning: ISO C++ forbids converting a string constant to 'char
' [-Wwrite-strings]
int electrodeNum = atoi(splitString(receivedChars, ":", 1));
^
/Users/giorgio/Documents/Arduino/libraries/MPR121/MPR121_Datastream.cpp:137:55: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
int value = atoi(splitString(receivedChars, ":", 2));
^
/Users/giorgio/Documents/Arduino/libraries/SFEMP3Shield/SFEMP3Shield.cpp: In member function 'uint8_t SFEMP3Shield::vs_init()':
/Users/giorgio/Documents/Arduino/libraries/SFEMP3Shield/SFEMP3Shield.cpp:292:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
if(VSLoadUserCode("patches.053")) return 6;

@ardugigi, your topic has been moved to a more suitable location on the forum

===

Those are not errors but warnings and are most of the times harmless (not sure about those specific ones). If you post your complete sketch (using code tags) and tell us where we can find any non-standard libraries, it will be possible to advise further.

I think this one is because someone made the second argument to 'splitString()' a 'char *' and not a 'const char *'. The function is not promising not to change the string you pass so, if ISO C++ standards were enforced, you would not be allowed to pass a string constant to that function. USUALLY this is just lazy programming on the part of the function writer (all 'char *' argus should be 'const char *' unless the function changes the string).

This is odd because it seems to imply that the second argument to 'splitString()' is 'char' and not 'char *' as implied above.

Same as the first one. Probably just lazy programming.

Thank you!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.