Re: Use C99 designated initializers for some structs - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Use C99 designated initializers for some structs
Date
Msg-id df7e856a-3481-8ca2-2ee1-0b694af0c6d0@2ndquadrant.com
Whole thread Raw
In response to Re: Use C99 designated initializers for some structs  (Andres Freund <andres@anarazel.de>)
List 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


pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Unused argument from execute_sql_string()
Next
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Refactor dlopen() support