Repository navigation
module_interface.h: add forward struct comp_dev and timestamp_data - #7945
Conversation
Fixes commit 9cc6454 ("module_adapter: Extend the module interface for endpoint devices") As the endpoint_ops methods use only pointers to these two objects, it's not necessary to make their entire object structure visible. However a forward declaration is required to make them known to endpoint_ops users and fix the following warning: ``` error: 'struct comp_dev' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] ``` Signed-off-by: Marc Herbert <marc.herbert@intel.com>
|
It's still a mystery why Github Actions did not catch this in the original PR #7890 https://github.com/thesofproject/sof/actions/runs/5514181363/jobs/10053140087 Even weirder: it passed with the zephyr manifest in but not with the zephyr main branch in https://github.com/thesofproject/sof/actions/runs/5545805201/jobs/10125245211?pr=7932 for #7932?!? This misled me into wasting a bit of time with an irrelevant zephyr git bisect... Sometimes PR A and PR B can both pass and not together but I don't see how this could have happened here Of course it depends on whether this .h file is actually used or not but how could it have been used before being merged? EDIT: https://stackoverflow.com/questions/16831605/strange-compiler-warning-c-warning-struct-declared-inside-parameter-list has a good explanation. |
btian1
left a comment
There was a problem hiding this comment.
one question is: why CI does not report error before merge, and report error after merge?
line 70-71 add is needed, then how about below structure?
sof_ipc_stream_posn
sof_ipc_stream_params
input_stream_buffer
module_cfg_fragment_position
See the first comment.
Simply because Other .c files get other .h files in other ways, otherwise the compiler would complain the same. |
|
All warnings fixed by this PR in https://github.com/thesofproject/sof/actions/runs/5549210444/jobs/10133047386?pr=7945 Today's daily builds failed consistently: MTL and LNL all failed whatever the Zephyr version is while the others never failed: |
| }; | ||
|
|
||
| struct comp_dev; | ||
| struct timestamp_data; |
There was a problem hiding this comment.
actually this file also should include stdint.h and stdbool.h
I think it worked originally because everywhere where this header was included originally also other headers were already available and now something changed somewhere - either the order of includes, or a new one was added without that accidental fix, or a header got removed somewhere. |
... which means it could break again, so maybe @btian1 has a point? Should we try to compile this .h file with a empty.c file and see what happens, would that help? This looks very relevant: |
|
Will take this now as it fixes build with some configs, can be refined further if needed. |
Fixes commit 9cc6454 ("module_adapter: Extend the module interface for endpoint devices")
As the endpoint_ops methods use only pointers to these two objects, it's not necessary to make their entire object structure visible. However a forward declaration is required to make them known to endpoint_ops users and fix the following warning: