warning: "x" macro redefined #75734
Unanswered
alexpaschoaletto
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
TL:DR
How does Zephyr deal with redefinition of macros? How to properly work with those on kernel implementations?
Context
Proceeding to the next step in the journey of implementing a new kernel feature which I started here, I'm now struggling to understand how do the tracing subsystems fare with the redefinition of macros. In fact I'll catch the same example as the previous discussion, since it's the one I'm trying to work with right now.
Here's a snippet found in
zephyr/include/zephyr/tracing.h
:And this is the snippet found in 3 different header files -
zephyr/subsys/tracing/ctf/tracing_ctf.h
for example:What's the underlying magic happening here that allows both defines to coexist without triggering the
warning: "sys_port_trace_k_thread_switched_out" redefined
when building the file? If I try to do this in my own new subsystem, however, it WILL give the warnign and the execution will be messed up.Thank you once again for your time and attention.
Beta Was this translation helpful? Give feedback.
All reactions