cancel
Showing results for 
Search instead for 
Did you mean: 

Definition of MIN and MAX in crypto lib

PADAM.1
Associate III

Hello

File "STM32_Cryptographic/Inc/Common/macros.h" defines macros MIN and MAX without any "#ifndef" around. Thus compiler warnings "redefined" are generated, if the file is included by customer code after headers of BLE stack.

File STM32WPAN/ble/ble_common.h has following code:

#ifndef MAX

#define MAX( a, b )           (((a) > (b)) ? (a) : (b))

#endif

File STM32WPAN/stm32_wpan_common.h has following code:

#undef MAX

#define MAX(a, b) (((a) > (b)) ? (a) : (b))

One of these codes should also be applied in macros.h of crypto lib (same for MIN etc).

Best regards

Paul

1 REPLY 1
PADAM.1
Associate III

Hello

there is a similar "opportunity to enhance" for "PAUSE":

In file included from ../Core/Inc/main.h:34,

                ...

                from ../STM32_WPAN/App/custom_stm.c:27:

../Core/Inc/app_common.h:85: warning: "PAUSE" redefined

  85 | #define PAUSE( t )          M_BEGIN \

     |

In file included from ../Middlewares/ST/STM32_WPAN/ble/svc/Inc/otas_stm.h:31,

                from ../Middlewares/ST/STM32_WPAN/ble/ble.h:55,

                from ../Middlewares/ST/STM32_WPAN/ble/svc/Src/common_blesvc.h:32,

                from ../STM32_WPAN/App/custom_stm.c:23:

../Middlewares/ST/STM32_WPAN/stm32_wpan_common.h:113: note: this is the location of the previous definition

 113 | #define PAUSE( t )          M_BEGIN \

     |

BR

Paul