Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COMPILER_FALLTHROUGH

Copy link
Collaborator Author

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?

Copy link
Collaborator

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:

#if ((defined(__GNUC__) && (__GNUC__ >= 7)) || \
(defined(__clang__) && (__clang_major__ >= 10))) && !defined(__CHECKER__)
#define COMPILER_FALLTHROUGH __attribute__((fallthrough))
#else
#define COMPILER_FALLTHROUGH /* fallthrough */
#endif
- the only possibility I see for that not to work for you is if in your case the __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)

Copy link
Collaborator

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

case SOF_IPC4_PIPELINE_STATE_SAVED:
case SOF_IPC4_PIPELINE_STATE_ERROR_STOP:
default:
Expand Down
Loading