Did Particle: Environment Reset
I have a project that I can build in the cloud using the Web IDE as well as from Workbench Cloud Build. No issues/warning. However, when I build locally (with out without OS) I see this warning
warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] char *tempStr = getTagValue(commandParameters, "T");
Now I realize that I need to fix this C++ code but I’m not sure how to. So my questions are:
- Why, when I build in the cloud I don’t see this warning.
- How do I fix this warning (I’m not a full time C++ programmer)?
The getTagValue method’s signature looks like this
char *getTagValue(char *a_tag_list, char *a_tag)
The code that has the issue is
char commandParameters[length + 1]; memcpy(commandParameters, &payload, length); char *tempStr = getTagValue(commandParameters, "T");
where payload is
Essentially the getTagValue method parses the delimited
char* in the form
so when I call getTagValue like so:
char *tempStr = getTagValue(commandParameters, "name2");
I get value2 as the returned value