Re: gcc 12.1.0 warning - Mailing list pgsql-hackers

From Tom Lane
Subject Re: gcc 12.1.0 warning
Date
Msg-id 2891033.1651848380@sss.pgh.pa.us
Whole thread Raw
In response to gcc 12.1.0 warning  (Erik Rijkers <er@xs4all.nl>)
List pgsql-hackers
Erik Rijkers <er@xs4all.nl> writes:
> 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);
>        |                                 ~~~~~^~~~~~

I'd call that a compiler bug.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: make MaxBackends available in _PG_init
Next
From: Nathan Bossart
Date:
Subject: Re: make MaxBackends available in _PG_init