Re: Remove unnecessary static type qualifiers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove unnecessary static type qualifiers
Date
Msg-id 3977290.1744121615@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove unnecessary static type qualifiers  (Junwang Zhao <zhjwpku@gmail.com>)
List pgsql-hackers
Junwang Zhao <zhjwpku@gmail.com> writes:
> On Tue, Apr 8, 2025 at 4:29 PM Japin Li <japinli@hotmail.com> wrote:
>> -       static const char query[] = "set client_encoding to '%s'";
>> +       const char      query[] = "set client_encoding to '%s'";

> I doubt that, if you remove the *static*, it will allocate more memory
> on stack and need more instructions to copy the string to that area.

Yeah, it's not an improvement as written.  This might be OK:

>> +       const char      *query = "set client_encoding to '%s'";

But I kinda doubt it's worth touching.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Some problems regarding the self-join elimination code
Next
From: Tom Lane
Date:
Subject: Re: prevent 006_transfer_modes.pl from leaving files behind