-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/thread_flags: remove #error from header file #13671
Conversation
This commit removes the #error from the thread_flags header. This #error makes the usage of if(IS_USED(MODULE_THAT_DEPENDS_ON_THREAD_FLAGS)) pattern harder, because the error is triggered each time the header is included. If a module uses any thread_flags function it will fail in link time anyway.
don't include headers you don''t use? |
This leads to a lot of ugly |
This. You need to add the header files for that pattern: #include "A.h"
if (IS_USED(MODULE_A)) {
function_in_header_a();
}
another_function(); It will fail if you didn't include "A.h" header. |
Yes, but as soon as we add |
Well, the function doesn't exist now, right? And as soon as someone add it, you only need to guard the function instead of a whole snippet of code. That's what it was done in #13669 |
Then we introduce that like this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
And go! |
Contribution description
This commit removes the #error from the thread_flags header.
This #error makes the usage of
if(IS_USED(MODULE_THAT_DEPENDS_ON_THREAD_FLAGS)) pattern harder,
because the error is triggered each time the header is included.
If a module uses any thread_flags function it will fail in link time
anyway.
Testing procedure
Try removing the
core_thread_flags
dependency from any component that requires thread flags (e.g/tests/thread_flags_xtimer
. It should fail.Issues/PRs references
#13669