Re: Remove unnecessary static specifier

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Japin Li <japinli(at)hotmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove unnecessary static specifier
Date: 2025-02-05 16:05:15
Message-ID: 815395.1738771515@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> From a quick first inspection (and running the tests with the patch applied) I
> agree with this, these variables do not need to be static. I'll stare a bit
> more at this to make sure but seems like the right patch.

+1. All three of those variables are visibly assigned to before any
other reference, so they cannot carry data across calls of the
function.

While we're at it, could we make the adjacent "magic" string be
"static const char *magic"? (Probably needs a couple more
"const" modifiers at use sites, too.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-02-05 16:11:05 Re: [PATCH] SVE popcount support
Previous Message Tom Lane 2025-02-05 15:51:17 Re: Failed assertion with jit enabled