-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
toolchain: Replace GCC_VERSION and BUILD_ASSERT macros in gcc.h #51911
toolchain: Replace GCC_VERSION and BUILD_ASSERT macros in gcc.h #51911
Conversation
52274a4
to
ca1344c
Compare
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.
As per #51963, the modules should either conditionally define (if the semantics are equivalent to that of Zephyr) or rename; not the other way around.
#51963 seems to suggest that we use |
Sure, Since this is a toolchain abstraction layer-specific macro, |
GCC_VERSION is defined in a few modules, and those headers are often included first, so replace the one used in zephyr with TOOLCHAIN_GCC_VERSION. Do the same with CLANG_VERSION, replacing it with TOOLCHAIN_CLANG_VERSION. BUILD_ASSERT is also defined in include/toolchain/common.h, which might get included before gcc.h. We want to use the gcc-specific one instead of the general one. Signed-off-by: Keith Packard <keithp@keithp.com>
ca1344c
to
8537b65
Compare
Sounds good. I've rebased and pushed this version. |
@@ -64,6 +64,7 @@ | |||
#endif | |||
|
|||
|
|||
#undef BUILD_ASSERT /* clear out common version */ |
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.
BUILD_ASSERT is also defined in include/toolchain/common.h, which might
get included before gcc.h. We want to use the gcc-specific one instead
of the general one.
toolchain/common.h
is never supposed to be included before the toolchain-specific headers such as toolchain/gcc.h
; in fact, it should not be included by any files other than the toolchain-specific headers inside toolchain/
.
Properly documenting and enforcing that seems to be beyond the scope of this PR, however.
GCC_VERSION is defined in a few modules, and those headers are often included first, so we need to replace that definition with the Zephyr-specific one.
BUILD_ASSERT is also defined in include/toolchain/common.h, which might get included before gcc.h. We want to use the gcc-specific one instead of the general one.
Signed-off-by: Keith Packard keithp@keithp.com