stdio_ext.h function implementations

Yaakov Selkowitz
Tue Dec 9 20:58:00 GMT 2014

Currently, the bulk of the <stdio_ext.h> functions[1][2] are implemented 
as inline code, or macros on non-gcc-compatible toolchains.  However, 
there are a few issues with that:

* Header-only implementations result in false negatives from 
AC_CHECK_FUNC tests and the like.  For instance, cpio FTBFS on Cygwin 
currently because it tries to implement a replacement for a "missing" 
__fpending which conflicts with the one already in <stdio_ext.h>.

* The Solaris and Linux documentation indicates that at least some, if 
not all, of these functions are thread-safe.  Does the current 
implementation suffice for that, or do these need to be real functions 
wrapped in _newlib_flockfile_{start,end} calls?

* Macro implementations of libc functions need to be undef'ed and backed 
by real functions with C++ (otherwise you get syntax errors in the 
::func form).  Are the inline implementations used by GCC safe for these 

* No documentation is generated for these functions.

In any case, for the first point alone, we need real code 
implementations of these functions.  I am prepared to make a patch for 
this, but exactly how depends on the second and third points above.


Yaakov Selkowitz
Associate Software Engineer, ARM
Red Hat, Inc.

More information about the Newlib mailing list