Hello everybody!
I'd kindly ask some assistance about an apparent inconsitency between the Windows and Linux C++ compiler.
I'm experiencing the renowned warning message ISO C++ forbids converting a string constant to 'char *' [-Wwrite-strings]
on assignments like char *mode_labels[] = {"LSB", "USB", "AM", "CW"};
only while compiling within the Windows IDE, and not getting any feedback at all on this in the Linux environment.
Just to be sure an IDE version mismatch hasn't to do with this, I upgraded both Windows and Linux machines to current IDE version 1.8.19 today, but this didn't improve.
This inconsistency is challenging while collaborating on the same project from different platforms, and compilation output varies.
Can anyone provide any hint?
You also need to check if you have the latest boards package for the arduino board you are programming, as well as the same versions of the libraries used by the sketch.
Note that the warning will be eliminated if you proper declare the char * as const
This tells the compiler that mode_labels is an array of const char * , where the data pointed to by the char * cannot be changed, while the const char* stored in the array itself can be changed.
LoL!! Thank you for this turning point question!
Actually that was the point: the compiler verbosity on Windows was higher than on Linux.
By the way, it could be worth sharing that the Windows IDE was showing the "None" verbosity level in the Settings dialog box, even while showing the above messages at compilation time. (That settings had not been changed since the IDE installation). Only after changing it to "Default" and back to "None", the "None" settings applied. Maybe the drop-down list setting is not matching the effective initial value for that option.