[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] test-select-stdin.c: avoid warn_unused_result warnings
From: |
Jim Meyering |
Subject: |
Re: [PATCH] test-select-stdin.c: avoid warn_unused_result warnings |
Date: |
Thu, 14 Oct 2010 09:33:28 +0200 |
Jim Meyering wrote:
> Hi Bruno,
>
> Is this ok with you?
Since this is merely making test-select-stdin.c
consistent with its much-larger parent, test-select.c,
and doesn't even require an added dependency or
File:/macros.h listing, I think it is uncontroversial.
Pushed. I hope that's ok.
> With this, the other changes posted here today, as well as
> one more in coreutils (to exempt 3 offenders I won't bother with),
> gnulib-tests/ now compiles with -Werror.
>
>>From 6ff0dbc6886418b68b6f19cfdaec34e751ae88ad Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Wed, 13 Oct 2010 11:22:35 +0200
> Subject: [PATCH] test-select-stdin.c: avoid warn_unused_result warnings
>
> * tests/test-select-stdin.c: Include "macros.h".
> ASSERT that read and fflush succeed.
> ---
> ChangeLog | 6 ++++++
> tests/test-select-stdin.c | 7 +++++--
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index b53e443..054879a 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,11 @@
> 2010-10-13 Jim Meyering <address@hidden>
>
> + test-select-stdin.c: avoid warn_unused_result warnings
> + * tests/test-select-stdin.c: Include "macros.h".
> + ASSERT that read and fflush succeed.
...
> diff --git a/tests/test-select-stdin.c b/tests/test-select-stdin.c
> index e9cee96..c88698c 100644
> --- a/tests/test-select-stdin.c
> +++ b/tests/test-select-stdin.c
> @@ -24,6 +24,8 @@
> #include <sys/time.h>
> #include <unistd.h>
>
> +#include "macros.h"
> +
> int
> main (void)
> {
> @@ -67,14 +69,15 @@ main (void)
> exit (1);
> }
> /* Timeout */
> - printf ("."); fflush (stdout);
> + printf (".");
> + ASSERT (fflush (stdout) == 0);
> }
> else
> {
> char c;
>
> printf ("Input available! Trying to read 1 byte...\n");
> - read (0, &c, 1);
> + ASSERT (read (0, &c, 1) == 1);
> }
> }
> }
> --
> 1.7.3.1.104.gc752e