bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] test-sys_socket: avoid set-but-not-used warnings from gcc


From: Bruno Haible
Subject: Re: [PATCH] test-sys_socket: avoid set-but-not-used warnings from gcc
Date: Fri, 11 Jun 2010 21:57:55 +0200
User-agent: KMail/1.9.9

Hi Jim,

> @@ -49,5 +49,5 @@ main (void)
>    x.ss_family = 42;
>    i = 42;
> 
> -  return 0;
> +  return ! (i + x.ss_family);
>  }

This makes is hard to understand that the return value is really 0. (It costs
extra brain cycles to see this.) Wouldn't it be possible to write this?

   (void) x;
   (void) i;
   return 0;

(I can't test it, as I don't have a gcc 4.6 snapshot installed.)

Bruno



reply via email to

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