Skip to content

Commit cd4c268

Browse files
marc-hbnashif
authored andcommitted
subsys tracing: remove (uintptr_t) casts in snprintk and use %p
Fixes -Werror=format: '%x' expects argument of type 'unsigned int', but argument N has type 'long unsigned int' Reproduced with sanitycheck -p bl652_dvk (or -p any other HAS_SEGGER_RTT) and by adding CONFIG_SEGGER_SYSTEMVIEW=y to samples/philosophers/prj.conf. sanitycheck adds -Werror. Signed-off-by: Marc Herbert <[email protected]>
1 parent 3f05740 commit cd4c268

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

subsys/debug/tracing/include/tracing_sysview.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ static inline void sys_trace_thread_info(struct k_thread *thread)
5656
{
5757
char name[20];
5858

59-
snprintk(name, sizeof(name), "T%xE%x", (uintptr_t)thread,
60-
(uintptr_t)&thread->entry);
59+
snprintk(name, sizeof(name), "T%pE%p", thread, &thread->entry);
6160

6261
SEGGER_SYSVIEW_TASKINFO Info;
6362

subsys/debug/tracing/sysview.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ static void send_task_list_cb(void)
6565
continue;
6666
}
6767

68-
snprintk(name, sizeof(name), "T%xE%x", (uintptr_t)thread,
69-
(uintptr_t)&thread->entry);
68+
snprintk(name, sizeof(name), "T%pE%p", thread, &thread->entry);
7069
SEGGER_SYSVIEW_SendTaskInfo(&(SEGGER_SYSVIEW_TASKINFO) {
7170
.TaskID = (u32_t)(uintptr_t)thread,
7271
.sName = tname?tname:name,

0 commit comments

Comments
 (0)