diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 6d8b005b2..c71f75dbc 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -812,7 +812,7 @@ extern _Thread_local int _tls_cvtlen; #define _REENT_CVTLEN(_ptr) (_tls_cvtlen) extern _Thread_local void (*_tls_cleanup)(struct _reent *); #define _REENT_CLEANUP(_ptr) (_tls_cleanup) -extern _Thread_local char _tls_emergency; +extern _Thread_local char _tls_emergency[_REENT_EMERGENCY_SIZE]; #define _REENT_EMERGENCY(_ptr) (_tls_emergency) extern _Thread_local int _tls_errno; #define _REENT_ERRNO(_ptr) (_tls_errno) diff --git a/newlib/libc/stdio/tmpnam.c b/newlib/libc/stdio/tmpnam.c index 51dfd1cea..dc04cf3f6 100644 --- a/newlib/libc/stdio/tmpnam.c +++ b/newlib/libc/stdio/tmpnam.c @@ -84,7 +84,7 @@ The global pointer <> is also required. #ifdef _REENT_THREAD_LOCAL _Thread_local int _tls_inc; -_Thread_local char _tls_emergency; +_Thread_local char _tls_emergency[_REENT_EMERGENCY_SIZE]; #endif /* Try to open the file specified, if it can't be opened then try