This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 0/9] Use more flags parameters instead of global bits in stdio
- From: Zack Weinberg <zackw at panix dot com>
- To: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 26 Mar 2018 11:46:59 -0400
- Subject: Re: [PATCH 0/9] Use more flags parameters instead of global bits in stdio
- References: <20180307193205.4751-1-zackw@panix.com> <20180326121624.67e57494@tereshkova>
On Mon, Mar 26, 2018 at 11:16 AM, Gabriel F. T. Gomes
<gabriel@inconstante.eti.br> wrote:
> On Wed, 07 Mar 2018, Zack Weinberg wrote:
>
>>I got stuck on the patch to use C99-compliant scanf in _GNU_SOURCE
>>mode because the interaction with ldbl-is-dbl was too confusing. The
>>reason it's too confusing is that C99 compliance in scanf, ldbl-is-dbl
>>mode in scanf, printf, and strfmon, and fortify mode in printf are
>>handled with mode bits on the FILE and thread-global flags that must
>>be set and reset at just the right times. Correct behavior is
>>invariably to set and then reset around just one call to a lower-level
>>function, and there's a better way to do that: flags parameters.
>>
>>This patch series implements _internal variants of scanf, printf,
>>strfmon, and syslog that take flag parameters that control C99
>>compliance, ldbl-is-dbl mode, and fortification.
>
> Thanks for doing this. It looks a lot less confusing now.
Thanks for reviewing. I will look at all your individual comments
when I cycle back to this patchset again, which might not be for a
while -- as I mentioned in another message, trying to get the hidden
annotations 100% correct has sent me down a rabbit hole (first "let's
write a test so that these problems are automatically detected in the
future", and then "... whoops, there are a lot of existing errors that
will need to be corrected before we can have that test", and now I'm
on "fixing some of those errors involves major surgery on libpthread
and ld.so" :-/ ) and meanwhile I do have a day job that has nothing to
do with any of this.
zw