[PATCH 1/1] add value for _h_errno in _REENT_INIT(var) for struct, _reent

Johannes Rosa johannes.rosa@web.de
Wed Jun 18 15:44:41 GMT 2025


The define '_REENT_INIT' for the case '!_REENT_SMALL' was missing an initializing value for 'int _h_errno'.
If code uses the _REENT_INIT() macro to preset a variable of type struct _reent, this led to an issue when compiling with -Wmissing-field-initializers.
---
 newlib/libc/include/sys/reent.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 5ce53873a..eafac960f 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -709,7 +709,8 @@ struct _reent
         {0, {0}}, \
         {0, {0}}, \
         {0, {0}}, \
-        {0, {0}} \
+        {0, {0}}, \
+		0 \
       } \
     }, \
     _REENT_INIT_RESERVED_6_7 \
-- 
2.34.1



More information about the Newlib mailing list