Merge pull request #1876 from cpforbes/gcc9

Backport fix for building ports/unix with gcc9 from micropython
This commit is contained in:
Scott Shawcroft 2019-05-13 09:36:54 -07:00 committed by GitHub
commit a6785d7ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -103,9 +103,11 @@ STATIC void strn_print_strn(void *data, const char *str, size_t len) {
strn_print_env->remain -= len;
}
#if defined(__GNUC__) && !defined(__clang__)
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// uClibc requires this alias to be defined, or there may be link errors
// when linkings against it statically.
// GCC 9 gives a warning about missing attributes so it's excluded until
// uClibc+GCC9 support is needed.
int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias ("vsnprintf")));
#endif