In file "vfprintf.c", the lines 609 and following look the following way:
if (_printf_float == NULL) {
if (prt_data.flags & LONGDBL)
GET_ARG (N, ap, _LONG_DOUBLE);
else
GET_ARG (N, ap, double);
}
else {
n = _printf_float (data, &prt_data, fp, pfunc, &ap);
}
If _printf_float is not defined (or more precisely: if it is NULL), the variable n does not have a defined value.
This will cause the printf()-type functions (vprintf(), sprintf() ...) to return an invalid value.
However, the GNU C++ standard library uses the value returned by vsnprintf() to allocate some memory. This means that the GNU C++ library will pass a bad value to the alloca() function as a consequence. On some microcontroller architectures, this may even cause the crash of the entire CPU.
In file "vfprintf.c", the lines 609 and following look the following way:
If
_printf_floatis not defined (or more precisely: if it isNULL), the variablendoes not have a defined value.This will cause the
printf()-type functions (vprintf(),sprintf()...) to return an invalid value.However, the GNU C++ standard library uses the value returned by
vsnprintf()to allocate some memory. This means that the GNU C++ library will pass a bad value to thealloca()function as a consequence. On some microcontroller architectures, this may even cause the crash of the entire CPU.