-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Fix support for Pi Pico and C11 #50206
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
Conversation
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.
Technically, static_assert
is only available in C++98C++11 and above, and it is a keyword (i.e. not a macro) in C23, but encoding all these details here would be an overkill given that both C++98 and C23 are very niche use cases.
In the long term, we want to detect these compiler features during the configuration step in the build system and expose them to the code (e.g. COMPILER_HAS_STATIC_ASSERT
)
#ifndef __cplusplus | ||
#ifndef static_assert |
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.
nested ifdefs should be avoided when possible.
#ifndef __cplusplus | |
#ifndef static_assert | |
#if !defined(__cplusplus) && !defined(static_assert) |
@ThadHouse Could you rebase and address the change request? |
@ThadHouse are you still working on this PR? |
Sorry, I've been busy. I'll work on getting it updated this weekend. |
@ThadHouse Ping? |
Currently if C11 or higher is enabled, many files fail to compile because static_assert is defined in multiple header files. Solve this by disabling the one in the HAL if the other macro is found Signed-off-by: Thad House <[email protected]>
Sorry its taken so long, I was swapped with work. Just pushed against the newest main. |
It would be really great if there were some information on how to reproduce the problem. From the way it's phrased, it really sounds like a bug, and probably should have been filed as one with form fields filled-in. |
Ok. Created one |
Currently if C11 or higher is enabled, many files fail to compile because they include assert.h and config_autogen.h, which define conflicting copies of static_assert. Disable the one in the hal if the other is found.
Closes #54190
Signed-off-by: Thad House [email protected]