customizing scanf ?
Carlos O'Donell
carlos@systemhalted.org
Sun Oct 11 15:02:20 GMT 2026
On Sun, Oct 11, 2026 at 10:17 AM Basile STARYNKEVITCH
<basile@starynkevitch.net> wrote:
> On Sun, 2026-10-11 at 10:09 -0400, Carlos O'Donell wrote:
> I tend to believe that scanf can be indirectly customized by using
> custom streams obtained by fopencookie.
Do you have a use case in your program that would work better with a scanf hook?
Can you expand on your requirements?
> I also believe that even customized printf is not often used in 2026
> (few software components on github are today using fopencookie).
There are a wide variety of packages outside of the github and gitlab
ecosystem (though we maintain GNU Toolchain mirrors on both).
You may wish to look at Debian Codesearch:
https://codesearch.debian.net/ for reference.
The history here is that it was added for decimal floating point.
This allowed libdfp to be implemented outside of glibc and evolve as
the standard evolved.
> Otherwise the GCC compiler would offer more support about them, perhaps
> implemented as standard compiler plugins shipped with recent GCC.
While gcc is part of "the implementation" for an ISO C conforming
development environment the library implementation of such functions
exist in glibc.
Cheers,
Carlos.
More information about the Libc-help
mailing list