Skip to content

Conversation

@RobinKastberg
Copy link
Contributor

This is causing errors on IAR toolchain.

Talking to the C standard and compiler folks, they don't like this, since it is not guaranteed that code and data pointers are the same size. However if we do the cast it goes through fine.

       return entry_point == idle;
                             ^
"/workdir/zephyr/kernel/include/kthread.h",230  Warning[Pa131]: this is a function pointer constant. Did you intend a function call?

       return entry_point == idle;
                          ^
"/workdir/zephyr/kernel/include/kthread.h",230  Error[Pe042]: operand types are incompatible ("void *" and "void (*)(void *, void *, void *)")

Copy link
Contributor

@andyross andyross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just declare the function to take k_thread_entry_t, which is a function pointer type we already have, and which all users of this validation framework should be using already.

cfriedt
cfriedt previously approved these changes Nov 14, 2024
This is causing errors on IAR toolchain.

Signed-off-by: Robin Kastberg <[email protected]>
@RobinKastberg RobinKastberg changed the title kernel: make void pointer cast explicit kernel: make z_is_idle_thread_entry take code ptr Nov 15, 2024
@RobinKastberg
Copy link
Contributor Author

changed the parameter type instead. This should be more correct

@nashif nashif merged commit 6532c2f into zephyrproject-rtos:main Nov 18, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Kernel size: XS A PR changing only a single line of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants