[prev in list] [next in list] [prev in thread] [next in thread] 

List:       coreutils-bug
Subject:    Re: canon-host.c disagreement (gnulib vs coreutils);
From:       Jim Meyering <jim () meyering ! net>
Date:       2005-06-24 6:13:40
Message-ID: 85aclgmgdn.fsf () pi ! meyering ! net
[Download RAW message or body]

Paul Eggert <eggert@CS.UCLA.EDU> wrote:
> I noticed the following disagreement between gnulib and coreutils:
>
> --- gnulib/lib/canon-host.c	2005-05-13 23:03:57 -0700
> +++ cu/lib/canon-host.c	2005-05-14 00:58:06 -0700
...
> I assume that this was due to a warning from "gcc -W" about a missing
> initializer.  But I prefer the gnulib style: it's easier to read.

Probably.

> How about if we just ask people to not use "gcc -W"?
>
> While we're on the subject, I've noticed that glibc is now using this style:
>
>     struct addrinfo hint = { 0, };
>
> The extra comma is an indication to the reader that we know there are
> missing zeros, and don't care.  This style can be used for any object
> in C89, e.g.:
>
>     mbstate_t initial_state = { 0, };

That's nice to know.  Thanks.

> where we don't know whether mbstate_t is a structure, or an integer,
> and the code works either way.
>
> So, I propose that we make the following patch to gnulib, and propagate
> this to coreutils:
>
> 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
>
> 	* canon-host.c (canon-host): Append trailing "," to 0 in
> 	initializer of struct addrinfo, as an indication that we don't
> 	care how many members the structure has.

Fine.  Thanks.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic