Skip to content

Commit a6785d7

Browse files
authored
Merge pull request adafruit#1876 from cpforbes/gcc9
Backport fix for building ports/unix with gcc9 from micropython
2 parents 52a8150 + b3939e2 commit a6785d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/utils/printf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ STATIC void strn_print_strn(void *data, const char *str, size_t len) {
103103
strn_print_env->remain -= len;
104104
}
105105

106-
#if defined(__GNUC__) && !defined(__clang__)
106+
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
107107
// uClibc requires this alias to be defined, or there may be link errors
108108
// when linkings against it statically.
109+
// GCC 9 gives a warning about missing attributes so it's excluded until
110+
// uClibc+GCC9 support is needed.
109111
int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias ("vsnprintf")));
110112
#endif
111113

0 commit comments

Comments
 (0)