Skip to content

Conversation

stephanosio
Copy link
Member

@stephanosio stephanosio commented Aug 4, 2022

This commit disables the potentially uninitialized variable warning
(-Wmaybe-uninitialized) for the lsm6dso_mode_set function because
GCC 12 and above may report a false positive warning claiming that the
ctrl2_ois variable may be used uninitialized.

Note that the ctrl2_ois variable is always set when aux_ctx != NULL
and is accessed if and only if aux_ctx != NULL, therefore it may
never be used uninitialized as the warning claims.

Signed-off-by: Stephanos Ioannidis root@stephanos.io

NOTE: This is required for the upcoming Zephyr SDK 0.15.0 release.

@erwango
Copy link
Member

erwango commented Aug 4, 2022

Depending on how the library is updated, I'd suggest adding a "Patch list" section in the README of this component to avoid erasing this patch on component update. See https://github.com/zephyrproject-rtos/hal_stm32/tree/main/stm32cube/stm32l4xx/README for instance.

@stephanosio stephanosio force-pushed the fix_lsm6dso_maybeuninit branch from e33da73 to 19dfa16 Compare August 4, 2022 17:16
@stephanosio
Copy link
Member Author

I'd suggest adding a "Patch list" section in the README of this component

@erwango Done. https://github.com/zephyrproject-rtos/hal_st/pull/11/files#diff-81dc8b8891ba007ea61b440ccd1f34c8fcf17d110f3eef6f96c28aa81a7ff5deR60-R61

This commit disables the potentially uninitialized variable warning
(`-Wmaybe-uninitialized`) for the `lsm6dso_mode_set` function because
GCC 12 and above may report a false positive warning claiming that the
`ctrl2_ois` variable may be used uninitialized.

Note that the `ctrl2_ois` variable is always set when `aux_ctx != NULL`
and is accessed if and only if `aux_ctx != NULL`, therefore it may
never be used uninitialized as the warning claims.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
@stephanosio stephanosio force-pushed the fix_lsm6dso_maybeuninit branch from 19dfa16 to a22b81d Compare August 5, 2022 06:48
@stephanosio stephanosio requested a review from erwango August 5, 2022 06:48
@stephanosio stephanosio requested a review from carlescufi August 9, 2022 17:26
@stephanosio
Copy link
Member Author

@erwango shall we merge this now?

@erwango
Copy link
Member

erwango commented Aug 22, 2022

@stephanosio I'd like to follow the process and get a second +1, if time permits.

@avisconti Would you mind having a quick look ?

@stephanosio
Copy link
Member Author

@avisconti or anyone else, please review. we will be switching to the Zephyr SDK 0.15.0 very soon and this needs to go in before that.

@erwango erwango merged commit cccbc24 into zephyrproject-rtos:master Aug 25, 2022
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