Skip to content

Commit bf39f54

Browse files
nordic-krchcarlescufi
authored andcommitted
kernel: thread: Add casting to pointers in the log message
Using char pointers for %p should be avoided in log messages. It will cause issues in configurations where logging strings are removed from the binary and they are not inspected when cbprintf packages from logging string are built. In that case any char pointers are treated as strings and copied into the pacakge body. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 99071f9 commit bf39f54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/thread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ static char *setup_thread_stack(struct k_thread *new_thread,
474474

475475
LOG_DBG("stack %p for thread %p: obj_size=%zu buf_start=%p "
476476
" buf_size %zu stack_ptr=%p",
477-
stack, new_thread, stack_obj_size, stack_buf_start,
478-
stack_buf_size, stack_ptr);
477+
stack, new_thread, stack_obj_size, (void *)stack_buf_start,
478+
stack_buf_size, (void *)stack_ptr);
479479

480480
#ifdef CONFIG_INIT_STACKS
481481
memset(stack_buf_start, 0xaa, stack_buf_size);

0 commit comments

Comments
 (0)