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] libio: use stdout in puts and putchar, etc [BZ #24051].


* 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


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