Re: Size vs size_t or, um, PgSize?

From: Yurii Rashkovskii <yrashk(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Size vs size_t or, um, PgSize?
Date: 2023-07-03 19:37:55
Message-ID: CA+RLCQznjC=EROmf9RbD=6ajvSi1zWy_56mk9+L0t6ftV9dNwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel,

On Mon, Jul 3, 2023 at 12:20 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:

> > On 3 Jul 2023, at 21:14, Yurii Rashkovskii <yrashk(at)gmail(dot)com> wrote:
>
> > That being said, going ahead with the global renaming of Size to size_t
> will mostly eliminate this clash in, say, five years when old versions will
> be gone. At least it'll be fixed then. Otherwise, it'll never be fixed at
> all. To me, having the problem gone in the future beats having the problem
> forever.
>
> I would also like all Size instances gone, but the cost during backpatching
> will likely be very high. There are ~1300 or so of them in the code, and
> that's a lot of potential conflicts during the coming 5 years of
> backpatches.
>
>
I understand. How about a workaround for extension builders? Something like

```
/* Use this if you run into Size type redefinition */
#ifdef DONT_TYPEDEF_SIZE
#define Size size_t
#else
typedef size_t Size;
#endif
```
This way, extension developers can specify DONT_TYPEDEF_SIZE. However, this
would have to be backported, but to minimal/no effect if I am not missing
anything.

Not beautiful, but better than freezing the status quo forever?

--
Y.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikael Kjellström 2023-07-03 20:23:02 Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?
Previous Message Daniel Gustafsson 2023-07-03 19:20:49 Re: Size vs size_t or, um, PgSize?