Skip to content

Conversation

@singalsu
Copy link
Collaborator

The build of testbench for MTL platform simulation causes this build fail (rebuilt-testbench -p mtl):

src/audio/module_adapter/module/generic.c:213:6:
error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (md->ops->prepare) {
^~~~~~~~~~~~~~~~

src/audio/module_adapter/module/generic.c:236:9:
note: uninitialized use occurs here
return ret;
^~~

Since it's a possibility to have a module without prepare() operation, the initialize to zero is added to avoid the return of undefined value.

Reported-by: Marc Herbert marc.herbert@intel.com

The build of testbench for MTL platform simulation causes this build
fail (rebuilt-testbench -p mtl):

src/audio/module_adapter/module/generic.c:213:6:
error: variable 'ret' is used uninitialized whenever 'if'
condition is false [-Werror,-Wsometimes-uninitialized]
        if (md->ops->prepare) {
            ^~~~~~~~~~~~~~~~

src/audio/module_adapter/module/generic.c:236:9:
note: uninitialized use occurs here
        return ret;
               ^~~

Since it's a possibility to have a module without prepare()
operation, the initialize to zero is added to avoid the
return of undefined value.

Reported-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: shastry <malladi.sastry@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu singalsu force-pushed the module_prepare_no_prepare_operation_fix branch from b0eda35 to 65464a1 Compare December 11, 2023 14:59
@lgirdwood
Copy link
Member

Will merge here since this is a build fix.

@lgirdwood lgirdwood merged commit 240cc97 into thesofproject:main Dec 11, 2023
@marc-hb
Copy link
Collaborator

marc-hb commented Dec 12, 2023

Just for the record: only clang seems to print this warning.

@singalsu singalsu deleted the module_prepare_no_prepare_operation_fix branch January 4, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants