Misra 2004 has the following rule:
Rule 16.1: Functions shall not be defined with variable numbers of arguments
Therefore, functions like printf
can't be used with rule 16.1.
uint32_t debug_print(char *format, ...)
{
int int_ret_val=0;
uint32_t ret_val = ERR_NO_ERROR;
va_list arguments;
va_start(arguments, format);
ret_val = vprintf(format, arguments);
va_end(arguments);
return ret_val;
}
I've searched for alternative but did not find any.
Is it that all family of c commands for logging a string formatted message ("%d,%f
,..") use variable list ?