Re: gcc 12.1.0 warning

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Erik Rijkers <er(at)xs4all(dot)nl>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: gcc 12.1.0 warning
Date: 2024-05-10 09:13:21
Message-ID: CAN55FZ0o9wqVoMTh_gJCmj_+4XbX9VXzQF8OySPZ0R1saxV3bA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, 23 Apr 2024 at 19:59, Andres Freund <andres(at)anarazel(dot)de> wrote:
>
>
> Which seems entirely legitimate. ISTM that guc_var_compare() ought to only
> cast the pointers to the key type, i.e. char *. And incidentally that does
> prevent the warning.
>
> The reason it doesn't happen in newer versions of postgres is that we aren't
> using guc_var_compare() in the relevant places anymore...

The fix is attached. It cleanly applies from REL_15_STABLE to
REL_12_STABLE, fixes the warnings and the tests pass.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
v1-0001-Fix-Warray-bounds-warning-in-guc_var_compare-func.patch text/x-patch 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-05-10 09:53:10 Re: consider -Wmissing-variable-declarations
Previous Message Anthonin Bonnefoy 2024-05-10 08:54:07 Use pgBufferUsage for block reporting in analyze