pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Rijkers <er@xs4all.nl>
To: pgsql-committers@lists.postgresql.org
Subject: gcc 12.1.0 warning
Date: Fri, 6 May 2022 16:30:08 +0200
Message-ID: <44790980-fdba-81aa-5432-190b36693564@xs4all.nl> (raw)

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.)

Below are the two configure lines, FWIW.


Erik Rijkers


# cassert-build: no warning/note
./configure \
--prefix=/home/aardvark/pg_stuff/pg_installations/pgsql.HEAD \
--bindir=/home/aardvark/pg_stuff/pg_installations/pgsql.HEAD/bin \
--libdir=/home/aardvark/pg_stuff/pg_installations/pgsql.HEAD/lib \
--with-pgport=6515 --quiet --enable-depend \
--enable-cassert --enable-debug \
--with-openssl --with-perl --with-libxml --with-libxslt --with-zlib \
--enable-tap-tests --with-extra-version=_0506_HEAD_701d --with-lz4


# normal build: causes warning/note:
./configure \
--prefix=/home/aardvark/pg_stuff/pg_installations/pgsql.HEAD \
--bindir=/home/aardvark/pg_stuff/pg_installations/pgsql.HEAD/bin.fast \
--libdir=/home/aardvark/pg_stuff/pg_installations/pgsql.HEAD/lib.fast \
--with-pgport=6515 --quiet --enable-depend \
--with-openssl --with-perl --with-libxml --with-libxslt --with-zlib \
--enable-tap-tests --with-extra-version=_0506_HEAD_701d --with-lz4





Message-ID: <44790980-fdba-81aa-5432-190b36693564@xs4all.nl>
Permalink:  ../44790980-fdba-81aa-5432-190b36693564@xs4all.nl/
Also on:    postgresql.org/message-id/44790980-fdba-81aa-5432-190b36693564@xs4all.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: er@xs4all.nl
  Subject: Re: gcc 12.1.0 warning
  In-Reply-To: <44790980-fdba-81aa-5432-190b36693564@xs4all.nl>
  References: <44790980-fdba-81aa-5432-190b36693564@xs4all.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox