Re: simplify regular expression locale global variables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: simplify regular expression locale global variables
Date: 2024-10-15 14:48:19
Message-ID: 3963293.1729003699@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> Hmm, is it valid to make pg_regex_locale point to a function-local
> static here? The lifetime of this static is not clear to me, and I
> think this pattern works with at least some compilers, but I remember
> comments on previous patch review threads that this pattern isn't
> kosher.

We use function-local statics in other places, and I have never
heard that it's not kosher. There would be little point in
declaring such a variable static at all if that didn't cause
it to have persistent storage.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-10-15 15:04:56 Re: simplify regular expression locale global variables
Previous Message Nathan Bossart 2024-10-15 14:43:41 Re: Improve node type forward reference