-
Notifications
You must be signed in to change notification settings - Fork 321
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
ipc4: handler: Add fallthrough comment to prevent compilation error #8228
Conversation
Add the fallthrough comment to prevent the error seen with shared library build: "handler.c:312:20: error: this statement may fall through [-Werror=implicit-fallthrough=]" Signed-off-by: Ranjani Sridharan <[email protected]>
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.
which build will show this error? I did not see it in my local build.
@@ -311,6 +311,7 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd) | |||
case SOF_IPC4_PIPELINE_STATE_EOS: | |||
if (status != COMP_STATE_ACTIVE) | |||
return IPC4_INVALID_REQUEST; | |||
/* fallthrough */ |
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.
COMPILER_FALLTHROUGH
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.
@lyakh compiler_fallthrough doesn't seem to help with the host build with ipc4. What am I missing?
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.
Ok, looking at the definition:
sof/xtos/include/sof/compiler_attributes.h
Lines 45 to 54 in 992dd67
#if ((defined(__GNUC__) && (__GNUC__ >= 7)) || \ | |
(defined(__clang__) && (__clang_major__ >= 10))) && !defined(__CHECKER__) | |
#define COMPILER_FALLTHROUGH __attribute__((fallthrough)) | |
#else | |
#define COMPILER_FALLTHROUGH /* fallthrough */ | |
#endif |
__attribute__((fallthrough))
definition is used, but that attribute isn't known to your compiler and it's ignoring an unknown attribute. Can you try -Wignored-attributes
(note, that when building with sparse enabled, the -Wno-attributes
option is used, which suppresses such warnings)
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.
Zephyr has a universal "fallthrough" that we could copy/re-use #8383 (comment)
cc: @singalsu
pulled into #8232 |
Add the fallthrough comment to prevent the error seen with shared library build:
"handler.c:312:20: error: this statement may fall through [-Werror=implicit-fallthrough=]"