Re: Use C99 designated initializers for some structs
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>,
Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Mark Dilger <hornschnorter@gmail.com>, David Steele
<david@pgmasters.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-09-07T09:45:20Z
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
Commits
-
Use C99 designated initializers for some structs
- 98afa68d9352 12.0 landed