firmware: Enable -Wformat and resolve all related compiler warnings

There have been tons of format-string related bugs in our code which
we never discovered due to disabling -Wformat.  Let's fix that.

Change-Id: I5ec466361bcc526fac1f4897673264ee5af3458b
This commit is contained in:
Harald Welte
2018-08-26 09:53:13 +02:00
parent 888f196595
commit c394109964
13 changed files with 24 additions and 23 deletions

View File

@@ -215,7 +215,7 @@ static void update_wt(uint8_t wi, uint8_t d)
wt_d = d;
}
wt = wt_wi*960UL*wt_d;
TRACE_INFO("WT updated to %u\n\r", wt);
TRACE_INFO("WT updated to %lu\n\r", wt);
}
/*! Allocate USB buffer and push + initialize simtrace_msg_hdr
@@ -325,7 +325,7 @@ static void print_flags(const struct value_string* flag_meanings, uint32_t nb_fl
uint32_t i;
for (i = 0; i < nb_flags; i++) {
if (flags & flag_meanings[i].value) {
printf(flag_meanings[i].str);
printf("%s", flag_meanings[i].str);
flags &= ~flag_meanings[i].value;
if (flags) {
printf(", ");