summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2019-05-13 09:36:54 -0700
committerGitHub <noreply@github.com>2019-05-13 09:36:54 -0700
commita6785d7ff74e156c5bcfdd8f46b1cccae41cc3bf (patch)
treee8c9e309b03fa972a2c408486eef64632ecce1a7
parent52a8150df3dc9aa692122c8dad0dc9bf30fcda9c (diff)
parentb3939e2513d0e9306f1652b17fab153fd8e9af84 (diff)
Merge pull request #1876 from cpforbes/gcc9
Backport fix for building ports/unix with gcc9 from micropython
-rw-r--r--lib/utils/printf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/utils/printf.c b/lib/utils/printf.c
index e19da2dc0..3a4cc2549 100644
--- a/lib/utils/printf.c
+++ b/lib/utils/printf.c
@@ -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