This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
reent.h: _REENT_INIT bug
- From: Engelthaler Jiří <Jiri dot Engelthaler at zat dot cz>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Mon, 5 Oct 2015 18:19:06 +0000
- Subject: reent.h: _REENT_INIT bug
- Authentication-results: sourceware.org; auth=none
Hi.
I have found a bug in _REENT_INIT. There are not filled all of items of _reent structure.
I have file test.c (not test.cpp!)
#include <reent.h>
struct _reent X = _REENT_INIT(X);
After invoking compiler :
gcc -c -Wextra test.c
I got two warnings:
test.c:3:8: warning: missing initializer for field '_h_errno' of 'struct <anonymous>' [-Wmissing-field-initializers]
struct _reent X = _REENT_INIT(X);
^
In file included from /usr/include/reent.h:93:0,
from test.c:1:
/usr/include/sys/reent.h:620:8: note: '_h_errno' declared here
int _h_errno;
^
test.c:3:8: warning: missing initializer for field '__sf' of 'struct _reent' [-Wmissing-field-initializers]
struct _reent X = _REENT_INIT(X);
^
In file included from /usr/include/reent.h:93:0,
from test.c:1:
/usr/include/sys/reent.h:646:10: note: '__sf' declared here
__FILE __sf[3]; /* first three file descriptors */
^
There is missing initializer for _h_errno and __sf items of _reent structure.
Jiri Engelthaler