[PATCH] libio: use stdout in puts and putchar, etc [BZ #24051].

Siddhesh Poyarekar siddhesh@gotplt.org
Thu Jan 3 13:17:00 GMT 2019


On 03/01/19 6:38 PM, Florian Weimer wrote:
> * 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.)

Fine from the freeze perspective, but this needs a more descriptive 
commit description.

Siddhesh



More information about the Libc-alpha mailing list