Re: Use C99 designated initializers for some structs

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Mark Dilger <hornschnorter(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use C99 designated initializers for some structs
Date: 2018-09-07 09:45:20
Message-ID: df7e856a-3481-8ca2-2ee1-0b694af0c6d0@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30/08/2018 22:14, Andres Freund wrote:
> I think we should have as rules:
>
> 1) Members should be defined in the same order as in the struct, that's
> the requirement C++ standard is going to impose. Think it's also
> reasonable stylistically.
> 2) It's OK to omit setting members if zero-initialization obviously is
> correct.

It seems like most people were OK with that, so I committed the patch.
This is something that we'll likely gain more experience with over time.

> We probably should also check how well pgindent copes, and whether that
> dictates some formatting choices.

The patch I submitted was run through pgindent. I did not experience
any problem, and it didn't reformat anything about what I had originally
typed in (except one comment I think).

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-09-07 09:47:29 Re: pgsql: Refactor dlopen() support
Previous Message Yugo Nagata 2018-09-07 09:05:04 Unused argument from execute_sql_string()