STM32CubeIDE generates invalid code for assert_failed function
I have 1.3.1 STM32CubeIDE. When I choose the generation for full assert the tool generates invalid declaration:
stm32l4xx_hal_conf.h (r. 427 ->)
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(char *file, uint32_t line);
#elseassert_failed is declared as f(char*, unsigned int) and char is signed. In main.c the definition is f(unsinged char *, unsigned int).
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line)
{
/* USER CODE BEGIN 6 */
......The definition differs from declaration the compilation always fails. Since I must use strict type checking and I am not allowed to change char from signed to unsigned. It would be nice if assert_failed is either char-based or uint8_t-based.
Anyway, in any coding standard that would be considered as fault. The declaration and the definition must be the same. It is not much, but it is nuisance.