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

Corinna Vinschen vinschen@redhat.com
Wed Jun 18 13:56:53 GMT 2025


Hi Johannes,

your patch is broken in terms of newlines.  Please fix.


Thanks,
Corinna

On May 19 22:01, Johannes Rosa wrote:
> 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