gcc 12.1.0 warning
Erik Rijkers <er@xs4all.nl>
From: Erik Rijkers <er@xs4all.nl>
To: pgsql-hackers@lists.postgresql.org
Date: 2022-05-06T14:34:41Z
Lists: pgsql-hackers
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
Commits
-
Fix bad indentation introduced in 43cd30bcd1c
- ff3cae4875d3 17.0 landed
- 212b0262d60e 16.4 landed
- 11441ad48d09 15.8 landed
- 3006fd8e6ece 14.13 landed
- 9d3a2b3cdfbd 13.16 landed
- 69bdee12e443 12.20 landed
- 47ecbfdfcc71 18.0 landed
-
Fix type confusion in guc_var_compare()
- ee89c4fa4b18 14.13 landed
- 92f02c39c0fa 12.20 landed
- 2cf9bda76cfd 13.16 landed
- b9f3db23b7b5 15.8 landed
- 2ad3b9350f73 16.4 landed
- 9b047cc0b2c2 17.0 landed
- 43cd30bcd1cd 18.0 landed