This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/9] Use more flags parameters instead of global bits in stdio


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.

>I regret the length
>and the messiness, and it might make sense to squash it on landing.

Although I haven't tested each patch in the patch set individually, they
look self-contained and I don't see a compelling reason to squash them.

I did, however, test a branch with all the patches applied on powerpc64 and
powerp64le.  The tests passed OK.

>I have manually hacked the patches that introduce vfprintf-internal.c
>and vfscanf-internal.c so the diffs are actually readable -- git doesn't
>handle "rename this file and then create a new file in its place" very
>well.

Thanks for pointing this out, it made it easier to know what to do in
order to apply them.


Overall, the patch set looks good to me.  I have some comments and
questions for each individual patch, which I'm sending right away.
(patches 1 through 5, that is. I didn't have time to write about patches
6 through 8).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]