8 years, 10 months ago.  This question has been closed. Reason: Off Topic

Set -funsigned-char flag when exporting to GCC

Here's a minor feature request for exporting to GCC and GCC-based environments (such as KDS and Atmel Studio): add the compiler flag -funsigned-char in exported projects by default.

The mbed handbook lists the char type as being unsigned (here), but the C standard does not specify, and in GCC chars are signed by default (see http://stackoverflow.com/a/2054959/1858923). This leads to errors when exporting projects that assume that chars are unsigned, such as Neil Thiessen's SDFileSystem. If we automatically set -funsigned-char in exported projects, we reduce the inconsistencies between the mbed online compiler and other target compilers for exported projects.

PS: I tried posting this as a "discussion," but it generated a 404 error.

1 Answer

8 years, 10 months ago.

Can you report this on github, where are templates for exporters, it should be fixed there. And the library should be checked as well, if it compilies with this flag enabled.

Accepted Answer

Thanks! I've posted an "issue" here: https://github.com/mbedmicro/mbed/issues/1525

posted by Aaron Campbell 03 Feb 2016