Hello,
When I compile mdma module (STM32H7, stable_20.3.x) with current gcc 10.2 compiler , -Wshadow flag, I meet this error :
../../../ChibiOS_20.3_stable/os/hal/ports/STM32/LLD/MDMAv1/stm32_mdma.c: In function 'mdmaInit':
../../../ChibiOS_20.3_stable/os/hal/ports/STM32/LLD/MDMAv1/stm32_mdma.c:168:39: error: declaration of 'ch' shadows a global declaration [-Werror=shadow]
168 | static MDMA_Channel_TypeDef * const ch[STM32_MDMA_CHANNELS] = {
| ^~
In file included from ../../../ChibiOS_20.3_stable/os/rt/include/ch.h:116,
from ../../../ChibiOS_20.3_stable/os/hal/osal/rt-nil/osal.h:32,
from ../../../ChibiOS_20.3_stable/os/hal/include/hal.h:28,
from ../../../ChibiOS_20.3_stable/os/hal/ports/STM32/LLD/MDMAv1/stm32_mdma.c:32:
../../../ChibiOS_20.3_stable/os/rt/include/chschd.h:469:20: note: shadowed declaration is here
469 | extern ch_system_t ch;
| ^~
I can circumvent the error with removing -Wshadow from Makefile, but it's sometime useful to find bugs.
Alexandre
global variable name "ch" shadow with MDMA Topic is solved
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: global variable name "ch" shadow with MDMA
Hi,
That variable has been renamed in latest code, I will also change it in 20.x.
Giovanni
That variable has been renamed in latest code, I will also change it in 20.x.
Giovanni
Who is online
Users browsing this forum: No registered users and 12 guests