Re: use of SPI by postgresImportForeignStatistics

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-11 07:26:56
Message-ID: CAPmGK145UuOhwO7+v+w4EhKGHb-R5F4Tc7S-Er5s-wwgrFxT4A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 10, 2026 at 11:08 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 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 didn't know that.

> 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.

Agreed.

> 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.

With that option I got a warning:

warning: unknown warning option '-Wtraditional' [-Wunknown-warning-option]

It looks like my compiler doesn't support that option, unfortunately.

Anyway, thanks for the explanation!

Best regards,
Etsuro Fujita

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-07-11 07:45:54 Re: Row pattern recognition
Previous Message vignesh C 2026-07-11 07:15:58 Re: sequencesync worker race with REFRESH SEQUENCES