Re: [PATCH 1/2] inet_ntop: silence gcc warning

2012-01-12 Thread Eric Blake
On 01/12/2012 05:04 AM, Jim Meyering wrote: > Eric Blake wrote: >> On 01/11/2012 04:44 PM, Paul Eggert wrote: >>> On 01/11/12 15:24, Eric Blake wrote: + best.len = 0; >>> >>> I have some qualms about adding unnecessary initializations >>> merely to silence GCC. It's not just that it bloats t

Re: [PATCH 1/2] inet_ntop: silence gcc warning

2012-01-12 Thread Jim Meyering
Eric Blake wrote: > On 01/11/2012 04:44 PM, Paul Eggert wrote: >> On 01/11/12 15:24, Eric Blake wrote: >>> + best.len = 0; >> >> I have some qualms about adding unnecessary initializations >> merely to silence GCC. It's not just that it bloats the >> runtime -- it's that it makes the code more co

Re: [PATCH 1/2] inet_ntop: silence gcc warning

2012-01-11 Thread Paul Eggert
On 01/11/12 16:01, Eric Blake wrote: > putting it inside #ifdef lint means you won't solve the compilation > warning in the default case. In the default case, GCC doesn't warn, right? That is, it warns only if you enable some flags such as -Wall? If so, it's OK if we ask people who set such flags

Re: [PATCH 1/2] inet_ntop: silence gcc warning

2012-01-11 Thread Eric Blake
On 01/11/2012 05:01 PM, Eric Blake wrote: > On 01/11/2012 04:44 PM, Paul Eggert wrote: >> On 01/11/12 15:24, Eric Blake wrote: >>> + best.len = 0; >> >> I have some qualms about adding unnecessary initializations >> merely to silence GCC. It's not just that it bloats the >> runtime -- it's that i

Re: [PATCH 1/2] inet_ntop: silence gcc warning

2012-01-11 Thread Eric Blake
On 01/11/2012 04:44 PM, Paul Eggert wrote: > On 01/11/12 15:24, Eric Blake wrote: >> + best.len = 0; > > I have some qualms about adding unnecessary initializations > merely to silence GCC. It's not just that it bloats the > runtime -- it's that it makes the code more confusing, because > later

Re: [PATCH 1/2] inet_ntop: silence gcc warning

2012-01-11 Thread Paul Eggert
On 01/11/12 15:24, Eric Blake wrote: > + best.len = 0; I have some qualms about adding unnecessary initializations merely to silence GCC. It's not just that it bloats the runtime -- it's that it makes the code more confusing, because later readers might mistakenly assume that the initializations

[PATCH 1/2] inet_ntop: silence gcc warning

2012-01-11 Thread Eric Blake
gcc -O2 couldn't tell that if best.base != -1, then best.len was necessarily initialized. * lib/inet_ntop.c (inet_ntop6): Initialize best.base. Reported by Daniel P. Berrange. Signed-off-by: Eric Blake --- ChangeLog |6 ++ lib/inet_ntop.c |1 + 2 files changed, 7 insertions(+)