So what? You do NOT have a String or String array.
Why this warning is not shown everywhere
Different versions of the IDE/tool chain? You have NOT supplied anywhere near enough details for a definitive answer.
and why i need const?
The function you are trying to pass that array to says that the argument is const. It means that the function won't change the data pointed to. The compiler expects you to
pass it a const array, agreeing that the function won't change the data.
lie to the function, telling it that the argument is so const, be using a cast.
PaulS:
Different versions of the IDE/tool chain? You have NOT supplied anywhere near enough details for a definitive answer.
Its the same Version installed at both computers, V 1.8.4
New intallations, nothing changed. New script only with this declaration.
The function you are trying to pass that array to says that the argument is const. It means that the function won't change the data pointed to. The compiler expects you to
No function, only the declaration shows this warning.
Of course i can ignore this but i want to understand it.
What type do you think "90 AA 14" is? If you said anything other than const char *, you'd be wrong.
You are trying to store a const char * in a char * array. Same choices outlined above. Make the array const char *, lie (using a cast), or ignore the warning.
Udo59:
Its the same Version installed at both computers, V 1.8.4
New intallations, nothing changed. New script only with this declaration.
No function, only the declaration shows this warning.
Of course i can ignore this but i want to understand it.
Check if you have different settings on the two computers at File > Preferences > Compiler warnings.
PaulS:
What type do you think "90 AA 14" is? If you said anything other than const char *, you'd be wrong.
You are trying to store a const char * in a char * array. Same choices outlined above. Make the array const char *, lie (using a cast), or ignore the warning.
OK, its a const char *. I'm new at this and just read the docu about string array. So it seems the docu is not correct.
pert:
Check if you have different settings on the two computers at File > Preferences > Compiler warnings.
That was the reason but warnings where already off. Changed something else(line numbers) and the warnings where really off.
PaulS:
What type do you think "90 AA 14" is? If you said anything other than const char *, you'd be wrong.
You are trying to store a const char * in a char * array. Same choices outlined above. Make the array const char *, lie (using a cast), or ignore the warning.
I don't know if you can do char* name[], personally I do only char name[]. Anyways warmungs are not so important, because they doesn't stop the compilation.
After pay attenton: String is an object (and it isn't very safety on Arduino), string is char array (look at the size of s)
Silente:
I don't know if you can do char* name[], personally I do only char name[].
char* name[] is an array of pointers, so yes, you can do that. How would you create a multideminsional array of c-strings?
Silente:
Anyways warmungs are not so important, because they doesn't stop the compilation.
They are extremely important; maybe not in this case but they tell you that your code might exhibit unexpected behaviour. It's up to the developer to determine what the effect will be.
Udo59:
OK, its a const char *. I'm new at this and just read the docu about string array. So it seems the docu is not correct.
Because, the compiler is trying to prevent you from shooting yourself in the foot. It's telling you that if the definition is left as-is, your code could dereference the pointer and inadvertently change the value of the string literals.
In the unlikely event that you actually want to dynamically change your 'commands', you can do something like this:
Silente:
Anyways warmungs are not so important, because they doesn't stop the compilation.
Warnings ARE important because they point out code that may be a mistake, even though the code is not strictly illegal. I always keep my warning level turned to ALL because I'd like to be told that I have made a silly mistake rather than later trying to figure out why my sketch is not doing what I thought I told it to do.
Many times I compile a sketch that someone says is "not working right" and find that the warnings point right to where they made a mistake.