[Picolibc] Replacing __iob with simple global variables

Keith Packard keithp at keithp.com
Thu Aug 12 22:43:13 PDT 2021


I've submitted a PR that replaces the tinystdio __iob array with simple
global FILE pointers stdin, stdout and stderr. This seems like a nice
clean-up for the library, making it more obviously compatible with POSIX
norms, avoiding array indexing when fetching these values which might
make code shorter on some platforms, and making it possible (through the
use of symbol aliasing) to share a single ROM location for all three
pointers.

The only snag is that this breaks API and ABI for existing applications,
so I'm slightly hesitant to merge it (once it passes tests, of course).

I can add a definition to stdio.h to make it easy for existing code to
declare the correct variables so that the same code could be used with
both versions of the API; is that sufficient compatibility?

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://keithp.com/pipermail/picolibc/attachments/20210812/8038fc91/attachment.sig>


More information about the Picolibc mailing list