diff --git a/boards/avsextrem/drivers/avsextrem-cc1100.c b/boards/avsextrem/drivers/avsextrem-cc1100.c index 705e087f4b..49237f0706 100644 --- a/boards/avsextrem/drivers/avsextrem-cc1100.c +++ b/boards/avsextrem/drivers/avsextrem-cc1100.c @@ -58,7 +58,7 @@ static int test_time(int code) time_value++; if (time_value > 10000000) { - printf("CC1100 SPI alarm: %u!\n", code); + printf("CC1100 SPI alarm: %d!\n", code); time_value = 0; return 1; } diff --git a/boards/msba2-common/tools/src/download.c b/boards/msba2-common/tools/src/download.c index f623e814b1..b25707e93d 100644 --- a/boards/msba2-common/tools/src/download.c +++ b/boards/msba2-common/tools/src/download.c @@ -641,7 +641,7 @@ static void download_main(int event) break; } - snprintf(buf, sizeof(buf), "W %d %d\r\n", chip->ram_addr, chip->chunk_size); + snprintf(buf, sizeof(buf), "W %u %d\r\n", chip->ram_addr, chip->chunk_size); xmit_cmd(buf, 4); return; @@ -721,7 +721,7 @@ static void download_main(int event) case XMIT_CKSUM: switch (event) { case BEGIN: - snprintf(buf, sizeof(buf), "%d\r\n", cksum); + snprintf(buf, sizeof(buf), "%u\r\n", cksum); xmit_cmd(buf, 3); return; @@ -795,7 +795,7 @@ static void download_main(int event) case BEGIN: printf("write, "); fflush(stdout); - snprintf(buf, sizeof(buf), "C %d %d %d\r\n", + snprintf(buf, sizeof(buf), "C %d %u %d\r\n", chip->layout[sector].address + sector_offset, chip->ram_addr, chip->chunk_size); xmit_cmd(buf, 5); @@ -856,7 +856,7 @@ static void download_main(int event) // bootloader again. Intead, we need to download a tiny ARM // program that reconfigures the hardware and then jumps to zero. //snprintf(buf, sizeof(buf), "G %d A\r\n", 0); - snprintf(buf, sizeof(buf), "W %d %d\r\n", chip->ram_addr, chip->bootprog[0] * 4); + snprintf(buf, sizeof(buf), "W %u %d\r\n", chip->ram_addr, chip->bootprog[0] * 4); xmit_cmd(buf, 4); return; @@ -938,7 +938,7 @@ static void download_main(int event) case BOOT_XMIT_CKSUM: switch (event) { case BEGIN: - snprintf(buf, sizeof(buf), "%d\r\n", cksum); + snprintf(buf, sizeof(buf), "%u\r\n", cksum); //printf("send: %s", buf); xmit_cmd(buf, 3); return; @@ -980,7 +980,7 @@ static void download_main(int event) switch (event) { case BEGIN: printf("jumping now!\r\n"); - snprintf(buf, sizeof(buf), "G %d A\r\n", chip->ram_addr); + snprintf(buf, sizeof(buf), "G %u A\r\n", chip->ram_addr); xmit_cmd(buf, 4); return; diff --git a/boards/msba2/msba2-cc110x.c b/boards/msba2/msba2-cc110x.c index 356c96a9fd..6c9bf97ffe 100644 --- a/boards/msba2/msba2-cc110x.c +++ b/boards/msba2/msba2-cc110x.c @@ -57,7 +57,7 @@ static int test_time(int code) time_value++; if (time_value > 10000000) { - printf("CC1100 SPI alarm: %u!\n", code); + printf("CC1100 SPI alarm: %d!\n", code); time_value = 0; return 1; } diff --git a/cpu/arm_common/arm_cpu.c b/cpu/arm_common/arm_cpu.c index a615327c2d..21b4d6c6c9 100644 --- a/cpu/arm_common/arm_cpu.c +++ b/cpu/arm_common/arm_cpu.c @@ -78,12 +78,12 @@ void thread_print_stack(void) s += 5; while (*s != STACK_MARKER) { - printf("STACK (%u) addr=%X = %X \n", i, (unsigned int) s, (unsigned int) *s); + printf("STACK (%d) addr=%X = %X \n", i, (unsigned int) s, (unsigned int) *s); s++; i++; } - printf("STACK (%u)= %X \n", i, *s); + printf("STACK (%d)= %X \n", i, *s); } int reboot_arch(int mode) diff --git a/cpu/arm_common/syscalls.c b/cpu/arm_common/syscalls.c index 9deb9edf68..370fa9e6fe 100644 --- a/cpu/arm_common/syscalls.c +++ b/cpu/arm_common/syscalls.c @@ -73,7 +73,7 @@ extern uintptr_t __heap3_max; ///< maximum for end of heap memory space /*-----------------------------------------------------------------------------------*/ void __assert_func(const char *file, int line, const char *func, const char *failedexpr) { - printf("#!assertion %s failed\n\t%s() in %s:%u\n", failedexpr, func, file, line); + printf("#!assertion %s failed\n\t%s() in %s:%d\n", failedexpr, func, file, line); _exit(3); } /*-----------------------------------------------------------------------------------*/ diff --git a/cpu/lpc1768/syscalls.c b/cpu/lpc1768/syscalls.c index 1160a7c830..411ec00c8c 100644 --- a/cpu/lpc1768/syscalls.c +++ b/cpu/lpc1768/syscalls.c @@ -64,7 +64,7 @@ void heap_stats(void) { /*-----------------------------------------------------------------------------------*/ void __assert_func(const char *file, int line, const char *func, const char *failedexpr) { - printf("#! assertion %s failed\n\t%s() in %s:%u\n", failedexpr, func, file, line ); + printf("#! assertion %s failed\n\t%s() in %s:%d\n", failedexpr, func, file, line ); _exit(3); } /*-----------------------------------------------------------------------------------*/ diff --git a/sys/net/network_layer/sixlowpan/icmp.c b/sys/net/network_layer/sixlowpan/icmp.c index 1ca7ff4d93..06a07a1ff6 100644 --- a/sys/net/network_layer/sixlowpan/icmp.c +++ b/sys/net/network_layer/sixlowpan/icmp.c @@ -270,7 +270,7 @@ void icmpv6_send_echo_request(ipv6_addr_t *destaddr, uint16_t id, uint16_t seq, #ifdef DEBUG_ENABLED char addr_str[IPV6_MAX_ADDR_STR_LEN]; - printf("INFO: send echo request (id = %04x, seq = %d, data_len = %d) to: %s\n", + printf("INFO: send echo request (id = %04x, seq = %d, data_len = %zu) to: %s\n", id, seq, data_len, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &ipv6_buf->destaddr)); #endif @@ -309,7 +309,7 @@ void icmpv6_send_echo_reply(ipv6_addr_t *destaddr, uint16_t id, uint16_t seq, ui #ifdef DEBUG_ENABLED char addr_str[IPV6_MAX_ADDR_STR_LEN]; - printf("INFO: send echo reply (id = %04x, seq = %d, data_len = %d) to: %s\n", + printf("INFO: send echo reply (id = %04x, seq = %d, data_len = %zu) to: %s\n", id, seq, data_len, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &ipv6_buf->destaddr)); #endif @@ -386,7 +386,7 @@ void recv_echo_req(void) ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &ipv6_buf->srcaddr)); printf("\n"); - printf("id = 0x%04x, seq = %d, data_len = %d\n", NTOHS(echo_buf->id), + printf("id = 0x%04x, seq = %d, data_len = %zu\n", NTOHS(echo_buf->id), NTOHS(echo_buf->seq), data_len); for (size_t i = 0; i < data_len; i++) { @@ -415,7 +415,7 @@ void recv_echo_repl(void) ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &ipv6_buf->srcaddr)); printf("\n"); - printf("id = 0x%04x, seq = %d, data_len = %d\n", NTOHS(echo_buf->id), + printf("id = 0x%04x, seq = %d, data_len = %zu\n", NTOHS(echo_buf->id), NTOHS(echo_buf->seq), data_len); for (size_t i = 0; i < data_len; i++) { diff --git a/sys/ps/ps.c b/sys/ps/ps.c index dc6a29c688..30270b4161 100644 --- a/sys/ps/ps.c +++ b/sys/ps/ps.c @@ -67,7 +67,7 @@ void thread_print_all(void) stacksz -= thread_measure_stack_free(p->stack_start); printf("\t%3u | %-21s| %-8s %.1s | %3i | %5i (%5i) %p" #if SCHEDSTATISTICS - " | %6.3f%% | %8u" + " | %6.3f%% | %8d" #endif "\n", p->pid, p->name, sname, queued, p->priority, p->stack_size, stacksz, p->stack_start diff --git a/sys/shell/commands/sc_id.c b/sys/shell/commands/sc_id.c index 36389f192d..04653ab185 100644 --- a/sys/shell/commands/sc_id.c +++ b/sys/shell/commands/sc_id.c @@ -27,7 +27,7 @@ void _id_handler(int argc, char **argv) } else { long newid = atoi(argv[1]); - printf("Setting new id %lu\n", newid); + printf("Setting new id %ld\n", newid); sysconfig.id = newid; if (!config_save()) { diff --git a/sys/shell/commands/sc_rpl.c b/sys/shell/commands/sc_rpl.c index 2117a4d818..0fe6f327ab 100644 --- a/sys/shell/commands/sc_rpl.c +++ b/sys/shell/commands/sc_rpl.c @@ -47,7 +47,7 @@ void _rpl_route_handler(int argc, char **argv) } } puts("--------------------------------------------------------------------"); - printf(" %d routing table entries\n", c); + printf(" %u routing table entries\n", c); puts("$"); } diff --git a/tests/test_posix_sleep/main.c b/tests/test_posix_sleep/main.c index eb9fd4cca2..a8ea9b0299 100644 --- a/tests/test_posix_sleep/main.c +++ b/tests/test_posix_sleep/main.c @@ -34,7 +34,7 @@ int main(void) puts("sleep 1"); for (int i = 0; i < 10; i++) { unsigned int s = i; - printf("calling sleep(%d)\n", s); + printf("calling sleep(%u)\n", s); sleep(s); puts("wake up"); } diff --git a/tests/test_queue_fairness/main.c b/tests/test_queue_fairness/main.c index 3f1a10fa64..d8c9f63281 100644 --- a/tests/test_queue_fairness/main.c +++ b/tests/test_queue_fairness/main.c @@ -71,7 +71,7 @@ int main(void) int cur_iteration = (int) m.type; char *child = (char *) m.content.ptr; - printf("Received message from %s, iteration %u / %u: %s\n", + printf("Received message from %s, iteration %d / %u: %s\n", child, cur_iteration, NUM_ITERATIONS, cur_iteration >= last_iteration ? "okay" : "ERROR");