From d2a259cef0eea43c467ed2b284e71ea371816b7e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 26 Oct 2015 11:08:19 -0200 Subject: [PATCH] DataFlash: fix wrong printf format for printf "%S" is used for wide string, but we are passing a char*. Use lowercase in this case to remove warnings like this: libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function 'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)': libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning: format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=] "Place vehicle %S and press any key.\n", msg); ^ --- libraries/DataFlash/LogFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index cc03c28029..eb81d1016d 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -320,7 +320,7 @@ void DataFlash_Backend::_print_log_entry(uint8_t msg_type, if (!ReadBlock(pkt, msg_len)) { return; } - port->printf("%S, ", _structures[i].name); + port->printf("%s, ", _structures[i].name); for (uint8_t ofs=0, fmt_ofs=0; ofsprintf("FMT, %u, %u, %S, %S, %S\n", + port->printf("FMT, %u, %u, %s, %s, %s\n", (unsigned)PGM_UINT8(&s->msg_type), (unsigned)PGM_UINT8(&s->msg_len), s->name, s->format, s->labels);