I'm developing a firmware for my STM32 board based on a STM32F412RET6 processor with STM32CubeIde and FREERTOS .
When I call the va_arg
function, of the stdarg.h
library, for the first time get me a strange number. Why?
The code:
void readFloat(int n, ...){
int val;
va_list vl;
va_start(vl,n);
for (int i=0;i<n;i++)
{
val=va_arg(vl,int);
}
va_end(vl);
}
/**
* @brief Function implementing the defaultTask thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void *argument)
{
readFloat(3, 1, 2, 3);
for(;;)
{
osDelay(1);
}
/* USER CODE END 5 */
}
The debug result: