Re: use of SPI by postgresImportForeignStatistics

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: use of SPI by postgresImportForeignStatistics
Date: 2026-07-10 14:08:05
Message-ID: 2862708.1783692485@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> writes:
> On Fri, Jul 10, 2026 at 4:40 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote:
>> On Fri, Jul 10, 2026 at 2:37 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>> Attached patch adds static to the definitions for consistency and
>>> to make their intended file-local scope explicit. It also fixes a few
>>> nearby comment typos.

> My compiler (Apple clang version 17.0.0 (clang-1700.4.4.1)) doesn't
> output any error/warning about that declaration. Actually, it's
> allowed? Anyway, +1 for adding it for consistency.

The back story here is that that coding pattern is allowed by standard
C but traditionally (pre-ANSI C or so) wasn't. We used to have some
buildfarm animals that would warn about it, but none do today.

I think it's a good idea to include "static" in the definitions for
clarity, and so that you don't have to go looking for the declaration
to know if a function is file-local or not. But the standard doesn't
require that.

Rummaging in the gcc manual, it looks like you can turn on a warning
for this with '-Wtraditional', but that also enables a boatload of
warnings we don't want, so I can't see using it on a regular basis.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-07-10 14:22:04 Re: Do not lock tables in get_tables_to_repack
Previous Message Greg Burd 2026-07-10 14:00:02 Re: [PATCH] Batched clock sweep to reduce cross-socket atomic contention