From 13a86e80d2fe0a3ccd5e98d9a9609038d203638d Mon Sep 17 00:00:00 2001 From: Andrey Borisovich Date: Wed, 1 Feb 2023 22:41:49 +0100 Subject: [PATCH] Fixed warnings issued by new xt-clang compiler New Xtensa xt-clang driver issues new warnings that were not present before when using xt-xcc driver. Fixed warnings related to enum cast to other enum by removing "frame_fmt" local variable assignment in the selector.c file. Assignment was not needed in the build_config function body, as the variable "frame_fmt" is passed in the next line to audio_stream_fmt_conversion function, that writes to this variable as output. Silenced warnings related to C/C++ interoperability. Signed-off-by: Andrey Borisovich --- src/audio/selector/selector.c | 2 -- .../sof/audio/module_adapter/iadk/system_service.h | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/audio/selector/selector.c b/src/audio/selector/selector.c index 59be98a28427..9c167ce70f5c 100644 --- a/src/audio/selector/selector.c +++ b/src/audio/selector/selector.c @@ -579,14 +579,12 @@ static void build_config(struct comp_data *cd, struct module_config *cfg) enum sof_ipc_frame __sparse_cache frame_fmt, valid_fmt; int i; - frame_fmt = cfg->base_cfg.audio_fmt.depth; audio_stream_fmt_conversion(cfg->base_cfg.audio_fmt.depth, cfg->base_cfg.audio_fmt.valid_bit_depth, &frame_fmt, &valid_fmt, cfg->base_cfg.audio_fmt.s_type); cd->source_format = frame_fmt; - frame_fmt = cd->sink_format; audio_stream_fmt_conversion(cd->output_format.depth, cd->output_format.valid_bit_depth, &frame_fmt, &valid_fmt, diff --git a/src/include/sof/audio/module_adapter/iadk/system_service.h b/src/include/sof/audio/module_adapter/iadk/system_service.h index b39c060e7664..ae253b99cd90 100644 --- a/src/include/sof/audio/module_adapter/iadk/system_service.h +++ b/src/include/sof/audio/module_adapter/iadk/system_service.h @@ -13,6 +13,11 @@ #include +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wextern-c-compat" +#endif //__clang__ + #ifdef __cplusplus extern "C" { #endif @@ -233,4 +238,8 @@ struct SystemService : public AdspSystemService {}; } #endif +#ifdef __clang__ +#pragma clang diagnostic pop // ignored "-Wextern-c-compat" +#endif //__clang__ + #endif /* _ADSP_SYSTEM_SERVICE_H_ */