coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] maint: avoid a new -Werror=return-type warning in yes.c


From: Bernhard Voelker
Subject: Re: [PATCH] maint: avoid a new -Werror=return-type warning in yes.c
Date: Wed, 29 Apr 2015 08:12:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 04/29/2015 12:10 AM, Pádraig Brady wrote:
> * src/yes.c (main): Simplify the logic so that the
> compiler can see this function always returns a value.
> This was seen with GCC 5.0 in SINGLE_BINARY mode.
> ---
>  src/yes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/yes.c b/src/yes.c
> index 3b7b4c6..07885be 100644
> --- a/src/yes.c
> +++ b/src/yes.c
> @@ -115,7 +115,7 @@ main (int argc, char **argv)
>  
>    /* If the data doesn't fit in BUFSIZ then output
>       what we've buffered, and iterate over the remaining items.  */
> -  while (i != argc)
> +  while (true /* i != argc */)
>      {
>        int j;
>        if ((pbuf - buf) && fwrite (buf, pbuf - buf, 1, stdout) != 1)
> 

Nice one!

Thanks & have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]