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