I think this is ok. A BSP should not be defining standard named symbols. Does any code internally use PAGESIZE? Just checking for side-effects.
It probably should be in an ifndef RTEMS block with a comment above to make it easier to potentially update this file in the future. --joel On Thu, Jan 28, 2021, 6:25 AM Robin Mueller <robin.muelle...@gmail.com> wrote: > --- > > I had a warning related to nameclash of defines for the arm/stm32h7 BSP. > More specifically, the define PAGESIZE which is defined in > stm32_hal_legacy.h > as well as in limits.h (which is located in arm-rtems6/include) > > I solved the problem for now by commenting out the define in > stm32_hal_legacy.h > > The BSP still built without issues. I searched the stm32h7 BSP folder in > the sources > to check whether the legacy define is actually used somewhere and it is > not. > > bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h > b/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h > index c311c1618e..c4fa5d7151 100644 > --- a/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h > +++ b/bsps/arm/stm32h7/include/Legacy/stm32_hal_legacy.h > @@ -420,7 +420,9 @@ > #define TYPEPROGRAMDATA_FASTBYTE FLASH_TYPEPROGRAMDATA_FASTBYTE > #define TYPEPROGRAMDATA_FASTHALFWORD FLASH_TYPEPROGRAMDATA_FASTHALFWORD > #define TYPEPROGRAMDATA_FASTWORD FLASH_TYPEPROGRAMDATA_FASTWORD > -#define PAGESIZE FLASH_PAGE_SIZE > +/* Commented out for the RTEMS BSP because there can be nameclashes with > another > +similar defininition in limits.h */ > +//#define PAGESIZE FLASH_PAGE_SIZE > #define TYPEPROGRAM_FASTBYTE FLASH_TYPEPROGRAM_BYTE > #define TYPEPROGRAM_FASTHALFWORD FLASH_TYPEPROGRAM_HALFWORD > #define TYPEPROGRAM_FASTWORD FLASH_TYPEPROGRAM_WORD > -- > 2.29.2.windows.2 > > _______________________________________________ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel >
_______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel