Re: Add Postgres module info
Yurii Rashkovskii <yrashk@omnigres.com>
From: Yurii Rashkovskii <yrashk@omnigres.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrei Lepikhov <lepihov@gmail.com>, Euler Taveira <euler@eulerto.com>, Robert Haas <robertmhaas@gmail.com>, Michael Paquier <michael@paquier.xyz>, Alexander Korotkov <aekorotkov@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-03-27T02:53:43Z
Lists: pgsql-hackers
On Wed, Mar 26, 2025 at 7:45 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > This recent patch is great but causes a small problem. It mixes > designated > > and non-designated initializers, specifically in > `PG_MODULE_MAGIC_DATA(0)`. > > Ugh. I felt a bit itchy about that, but my compiler wasn't > complaining... > That's because this is valid in C99/C11; it's just not valid in C++. That said, I think it's confusing and error-prone. > > Can you propose a specific change to clean it up? I wanted to write > just "PG_MODULE_MAGIC_DATA()", but I'm not sure that's valid C either. > > I was thinking about passing `.name = NULL, .version = NULL` instead of `0`—do you have any reservations about this? Yurii
Commits
-
Avoid mixing designated and non-designated field initializers.
- d66997dfe8fe 18.0 landed
-
Use PG_MODULE_MAGIC_EXT in our installable shared libraries.
- 55527368bd07 18.0 landed
-
Introduce PG_MODULE_MAGIC_EXT macro.
- 9324c8c58065 18.0 landed