On Fri, Jul 10, 2026 at 11:08 PM Tom Lane <[email protected]> wrote:
> Etsuro Fujita <[email protected]> writes:
> > On Fri, Jul 10, 2026 at 4:40 PM Etsuro Fujita <[email protected]> 
> > wrote:
> >> On Fri, Jul 10, 2026 at 2:37 PM Fujii Masao <[email protected]> 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


Reply via email to