Re: gcc 12.1.0 warning

Nazir Bilal Yavuz <byavuz81@gmail.com>

From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Erik Rijkers <er@xs4all.nl>, pgsql-hackers@lists.postgresql.org, Thomas Munro <thomas.munro@gmail.com>
Date: 2024-05-10T09:13:21Z
Lists: pgsql-hackers

Attachments

Hi,

On Tue, 23 Apr 2024 at 19:59, Andres Freund <andres@anarazel.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

Commits

  1. Fix bad indentation introduced in 43cd30bcd1c

  2. Fix type confusion in guc_var_compare()