Skip to content

Commit b2483c1

Browse files
committed
Minimal-printf: Fix wrapping of vsnprintf for ARM compiler
Substituting vsnprintf and vprintf instead of __2vsnprintf and __2vprintf respectively allows calls to vsnprintf and vprintf to be substituted with the minimal-printf variants for the ARM toolchain.
1 parent dc63202 commit b2483c1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

platform/source/minimal-printf/mbed_printf_armlink_overrides.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,12 @@ int $Sub$$__2snprintf(char *buffer, size_t length, const char *format, ...)
6666
return result;
6767
}
6868

69-
int $Sub$$__2vprintf(char *buffer, const char *format, ...)
69+
int $Sub$$vprintf(const char *format, va_list arguments)
7070
{
71-
va_list arguments;
72-
va_start(arguments, format);
73-
int result = mbed_minimal_formatted_string(buffer, LONG_MAX, format, arguments, stdout);
74-
va_end(arguments);
75-
76-
return result;
71+
return mbed_minimal_formatted_string(NULL, LONG_MAX, format, arguments, stdout);
7772
}
7873

79-
int $Sub$$__2vsnprintf(char *buffer, size_t length, const char *format, va_list arguments)
74+
int $Sub$$vsnprintf(char *buffer, size_t length, const char *format, va_list arguments)
8075
{
8176
return mbed_minimal_formatted_string(buffer, length, format, arguments, NULL);
8277
}

0 commit comments

Comments
 (0)