Web lists-archives.com

Re: [PATCH] strbuf: use designated initializers in STRBUF_INIT




On Mon, Jul 10, 2017 at 11:11:35PM +0200, Johannes Sixt wrote:

> > I am not sure what negative impact you think the macro-ness would
> > have to the validity of the result from this test balloon.  An old
> > compiler that does not understand designated initializer syntax
> > would fail to compile both the same way, no?
> > 
> > 	struct strbuf buf0 = STRBUF_INIT;
> > 	struct strbuf buf1 = { .alloc = 0, .len = 0, .buf = strbuf_slopbuf };
> 
> I said it is uninteresting, not that there is a negative impact. There is
> simply nothing gained for strbuf users: They would use STRBUF_INIT before
> and after the change and would not benefit from designated initializers.
> 
> This change may serve well as a test balloon, but not as an example of the
> sort of changes that we would want to see later (of the kind "change
> FOO_INIT macro to use designated initializers"; they are just code churn).

But that is exactly the point. First the test balloon, wait a release or
two, and then make real useful changes. The purpose of the test balloon
is to gather data with minimal impact. To be useful, the changes would
be pervasive, and that would not have minimal impact.

-Peff