Re: gcc 12.1.0 warning

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: gcc 12.1.0 warning
Date: 2023-10-27 10:09:01
Message-ID: CAN55FZ25T4Y3iYFpGp_DJagvQ7mVrgeYXfmJwCCtXeA1Frho-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, 27 Oct 2023 at 12:34, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>
> Hi,
>
> Not sure if these compiler-mutterings are worth reporting but I guess
> we're trying to get a silent compile.
>
> System: Debian 4.9.303-1 (2022-03-07) x86_64 GNU/Linux
> Compiling with gcc 12.1.0 causes the below 'warning' and 'note'.
> Compiling with --enable-cassert --enable-debug is silent, no warnings)
>
> In function ‘guc_var_compare’,
> inlined from ‘bsearch’ at
> /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:33:23,
> inlined from ‘find_option’ at guc.c:5649:35:
> guc.c:5736:38: warning: array subscript ‘const struct config_generic[0]’
> is partly outside array bounds of ‘const char[8]’ [-Warray-bounds]
> 5736 | return guc_name_compare(confa->name, confb->name);
> | ~~~~~^~~~~~
>
> guc.c: In function ‘find_option’:
> guc.c:5636:25: note: object ‘name’ of size 8
> 5636 | find_option(const char *name, bool create_placeholders, bool
> skip_errors,
> | ~~~~~~~~~~~~^~~~
>
> (Compiling with gcc 6.3.0 does not complain.)

I was testing 'upgrading CI Debian images to bookworm'. I tested the
bookworm on REL_15, REL_16 and upstream. REL_16 and upstream finished
successfully but the CompilerWarnings task failed on REL_15 with the
same error.

gcc version: 12.2.0

CI Run: https://cirrus-ci.com/task/6151742664998912

Regards,
Nazir Bilal Yavuz
Microsoft

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2023-10-27 10:34:16 Re: Synchronizing slots from primary to standby
Previous Message Smolkin Grigory 2023-10-27 10:03:23 Re: race condition in pg_class