[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnulib] lib/argp-help.c patch
From: |
Stepan Kasal |
Subject: |
Re: [bug-gnulib] lib/argp-help.c patch |
Date: |
Tue, 11 Jan 2005 11:26:59 +0100 |
User-agent: |
Mutt/1.4.1i |
Hi,
On Mon, Jan 10, 2005 at 07:48:10PM -0600, Albert Chin wrote:
> Initializing a struct with non-constant initializers is not
> C89-compliant
> +++ lib/argp-help.c 10 Jan 2005 20:45:12 -0000
...
> - struct pentry_state pest = { entry, stream, hhstate, 1, state };
> + struct pentry_state pest = { NULL, NULL, NULL, 1, NULL };
> +
> + pest.entry = entry;
> + pest.stream = stream;
> + pest.hhstate = hhstate;
> + pest.state = state;
Why not:
+ struct pentry_state pest;
+
+ pest.entry = entry;
+ pest.stream = stream;
+ pest.hhstate = hhstate;
+ pest.first = 1;
+ pest.state = state;
It's not much important that it brings compatibility with some compilers
which are not fully C89 compliant. But I think the code is more readable
this way.
Stepan