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

extraneous parentheses #13

Closed
RetoFx opened this issue May 30, 2024 · 3 comments
Closed

extraneous parentheses #13

RetoFx opened this issue May 30, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request flash FLASH-related issue or pull-request. hal HAL-LL driver-related issue or pull-request. wontfix This will not be worked on

Comments

@RetoFx
Copy link

RetoFx commented May 30, 2024

Hi
My ARMCLang report in file stm32f2xx_hal_flash_ex.c Line 654 and 658

*if((*(__IO uint8_t )(OPTCR_BYTE1_ADDRESS) == (uint8_t)OB_RDP_LEVEL_2))
{
readstatus = OB_RDP_LEVEL_2;
}
else if((
(__IO uint8_t )(OPTCR_BYTE1_ADDRESS) == (uint8_t)OB_RDP_LEVEL_0))

stm32f2xx_hal_flash_ex.c(654): warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

stm32f2xx_hal_flash_ex.c(658): warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

Please replace it with

*if((*(__IO uint8_t )(OPTCR_BYTE1_ADDRESS)) == ((uint8_t)OB_RDP_LEVEL_2))
{
readstatus = OB_RDP_LEVEL_2;
}
else if((
(__IO uint8_t )(OPTCR_BYTE1_ADDRESS)) == ((uint8_t)OB_RDP_LEVEL_0))

@ALABSTM ALABSTM added this to To do in stm32cube-mcu-fw-dashboard via automation May 31, 2024
@ALABSTM ALABSTM added enhancement New feature or request hal HAL-LL driver-related issue or pull-request. flash FLASH-related issue or pull-request. bug Something isn't working and removed enhancement New feature or request labels May 31, 2024
@ALABSTM
Copy link
Contributor

ALABSTM commented Jun 3, 2024

See also stm32f1xx_hal_driver#13

@TOUNSTM
Copy link
Contributor

TOUNSTM commented Jun 4, 2024

Hello @RetoFx,

Thank you for your contribution. As indicated in the STM32CubeF2 firmware release note, only template projects have been migrated to Arm Compiler 6 with MDK-ARM 5.31 using the “AC-like Warnings” mode. The warnings you've referenced do not fall under the category of "AC5-like warnings." As a result, we are unable to proceed with your change request.

We appreciate your understanding. Please allow me to close this issue.

With regards,

@TOUNSTM TOUNSTM closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
stm32cube-mcu-fw-dashboard automation moved this from To do to Done Jun 4, 2024
@TOUNSTM TOUNSTM added enhancement New feature or request wontfix This will not be worked on and removed bug Something isn't working labels Jun 4, 2024
@RetoFx
Copy link
Author

RetoFx commented Jun 4, 2024

It did not understand why you can't improve the code.

there are extraneous parentheses

(( (__IO uint8_t )(OPTCR_BYTE1_ADDRESS) == (uint8_t)OB_RDP_LEVEL_0 ))

the outer parentheses are double.
so either you remove one of them or add inner parentheses as I prefere because it addes clarification.

( ((__IO uint8_t )(OPTCR_BYTE1_ADDRESS)) == ((uint8_t)OB_RDP_LEVEL_0) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request flash FLASH-related issue or pull-request. hal HAL-LL driver-related issue or pull-request. wontfix This will not be worked on
Projects
Development

No branches or pull requests

3 participants