This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] libio: use stdout in puts and putchar, etc [BZ #24051].
- From: Florian Weimer <fweimer at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at gotplt dot org>
- Date: Thu, 03 Jan 2019 14:08:19 +0100
- Subject: Re: [PATCH] libio: use stdout in puts and putchar, etc [BZ #24051].
- References: <CALoOobOzXze3Ncu8FHhJwjttQnssrXG=XwS1gd=N7Cfgk=vadw@mail.gmail.com>
* Paul Pluzhnikov:
> diff --git a/libio/tst-bz24051.c b/libio/tst-bz24051.c
> new file mode 100644
> index 0000000000..52c7a64b5b
> --- /dev/null
> +++ b/libio/tst-bz24051.c
> @@ -0,0 +1,79 @@
> +/* Prevent putchar -> _IO_putc inline expansion. */
> +#define __NO_INLINE__
#pragma GCC optimize ("O0") seems prudent here as well, to inhibit any
printf uptimizations.
> + rewind (stdout);
> + TEST_VERIFY_EXIT (fgetws (buf, sizeof (buf), stdout) != NULL);
> + TEST_VERIFY (wcscmp (buf, L"abcdef") == 0);
You should use array_length (buf) here (and include <array_length.h>).
fgetws does not expect a ybte byte count.
Rest of the patch looks okay to me. (Siddhesh needs to ack this because
of the freeze.)
Thanks,
Florian