set default char type as unsigned (GCC -funsigned-char flag) in Eclipse
Posted: Thu May 10, 2018 11:52 pm
I get the error "pointer targets in initialization differ in signedness [-Werror=pointer-sign]" due to using unsigned char as the char type. So among other things, string literals assigned to uint8_t arrays cause warnings.
In a previous setup I had succeeded in configuring Eclipse to set the default char type to unsigned. However I forgot to write it down, and now I have a new setup, an avalanche of warnings, and I just spent an hour searching the internet in vain to correct this
What I do find are instructions for an unknown version of Eclipse, where one goes to Project Properties, C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> *Miscellaneous* -> Other Flags and puts in "-funsigned-char" for GCC. However in Eclipse Oxygen the dialog has changed and Miscellaneous is no longer to be found. Settings now has 2 tabs: "Binary Parsers" and "Error Parsers".
I tried adding the "-funsigned-char" to all these entries in the Workspace Settings (Discovery tab), but I observed no effect.
Maybe someone knows how to configure this? That would be a big relief!
In a previous setup I had succeeded in configuring Eclipse to set the default char type to unsigned. However I forgot to write it down, and now I have a new setup, an avalanche of warnings, and I just spent an hour searching the internet in vain to correct this
What I do find are instructions for an unknown version of Eclipse, where one goes to Project Properties, C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> *Miscellaneous* -> Other Flags and puts in "-funsigned-char" for GCC. However in Eclipse Oxygen the dialog has changed and Miscellaneous is no longer to be found. Settings now has 2 tabs: "Binary Parsers" and "Error Parsers".
I tried adding the "-funsigned-char" to all these entries in the Workspace Settings (Discovery tab), but I observed no effect.
Maybe someone knows how to configure this? That would be a big relief!