public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Bharath Rupireddy <[email protected]>
Cc: Alexander Korotkov <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: [email protected]
Subject: Re: pgsql: Add support event triggers on authenticated login
Date: Thu, 11 Jan 2024 21:55:19 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CALj2ACVQoFXxFm2kCmhHcdM7DjA84_bOjoM8HVAKHbE+KrZ1uA@mail.gmail.com>
References: <[email protected]>
<CALj2ACVQoFXxFm2kCmhHcdM7DjA84_bOjoM8HVAKHbE+KrZ1uA@mail.gmail.com>
Bharath Rupireddy <[email protected]> writes:
> Hi, I'm seeing a compiler warning with CFLAGS -O3 but not with -O2.
> In file included from dbcommands.c:20:
> dbcommands.c: In function ‘createdb’:
> ../../../src/include/postgres.h:104:16: warning: ‘src_hasloginevt’ may
> be used uninitialized in this function [-Wmaybe-uninitialized]
Hmm, I also see that at -O3 (not at -O2) when using Fedora 39's
gcc 13.2.1, but *not* when using RHEL8's gcc 8.5.0.
I'm not sure how excited I am about curing that, though, because gcc
13.2.1 spews several other totally baseless warnings (see attached).
Some of them match up with warnings we're seeing on buildfarm member
serinus, which I seem to recall that Andres had tracked to a known gcc
bug.
regards, tom lane
In file included from dbcommands.c:20:
In function 'BoolGetDatum',
inlined from 'createdb' at dbcommands.c:1379:52:
../../../src/include/postgres.h:104:16: warning: 'src_hasloginevt' may be used uninitialized [-Wmaybe-uninitialized]
104 | return (Datum) (X ? 1 : 0);
| ^~~~~~~~~~~~~~~~~~~
dbcommands.c: In function 'createdb':
dbcommands.c:683:25: note: 'src_hasloginevt' was declared here
683 | bool src_hasloginevt;
| ^~~~~~~~~~~~~~~
In file included from ../../../../src/include/executor/instrument.h:16,
from pgstat_io.c:19:
pgstat_io.c: In function 'pgstat_count_io_op_time':
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
In file included from ../../../../src/include/access/htup_details.h:22,
from pl_exec.c:21:
In function 'assign_simple_var',
inlined from 'exec_set_found' at pl_exec.c:8349:2:
../../../../src/include/varatt.h:230:36: warning: array subscript 0 is outside array bounds of 'char[0]' [-Warray-bounds=]
230 | (((varattrib_1b_e *) (PTR))->va_tag)
| ^
../../../../src/include/varatt.h:94:12: note: in definition of macro 'VARTAG_IS_EXPANDED'
94 | (((tag) & ~1) == VARTAG_EXPANDED_RO)
| ^~~
../../../../src/include/varatt.h:284:57: note: in expansion of macro 'VARTAG_1B_E'
284 | #define VARTAG_EXTERNAL(PTR) VARTAG_1B_E(PTR)
| ^~~~~~~~~~~
../../../../src/include/varatt.h:301:57: note: in expansion of macro 'VARTAG_EXTERNAL'
301 | (VARATT_IS_EXTERNAL(PTR) && !VARTAG_IS_EXPANDED(VARTAG_EXTERNAL(PTR)))
| ^~~~~~~~~~~~~~~
pl_exec.c:8537:17: note: in expansion of macro 'VARATT_IS_EXTERNAL_NON_EXPANDED'
8537 | VARATT_IS_EXTERNAL_NON_EXPANDED(DatumGetPointer(newvalue)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'exec_set_found':
cc1: note: source object is likely at address zero
Attachments:
[text/plain] gcc-13-2-1-warnings.txt (4.6K, 2-gcc-13-2-1-warnings.txt)
download | inline:
In file included from dbcommands.c:20:
In function 'BoolGetDatum',
inlined from 'createdb' at dbcommands.c:1379:52:
../../../src/include/postgres.h:104:16: warning: 'src_hasloginevt' may be used uninitialized [-Wmaybe-uninitialized]
104 | return (Datum) (X ? 1 : 0);
| ^~~~~~~~~~~~~~~~~~~
dbcommands.c: In function 'createdb':
dbcommands.c:683:25: note: 'src_hasloginevt' was declared here
683 | bool src_hasloginevt;
| ^~~~~~~~~~~~~~~
In file included from ../../../../src/include/executor/instrument.h:16,
from pgstat_io.c:19:
pgstat_io.c: In function 'pgstat_count_io_op_time':
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'instr_time[2][4][8]' [-Warray-bounds=]
149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../../src/include/portability/instr_time.h:179:11: note: in definition of macro 'INSTR_TIME_ADD'
179 | ((x).ticks += (y).ticks)
| ^
pgstat_io.c:27:25: note: while referencing 'pending_times'
27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];
| ^~~~~~~~~~~~~
In file included from ../../../../src/include/access/htup_details.h:22,
from pl_exec.c:21:
In function 'assign_simple_var',
inlined from 'exec_set_found' at pl_exec.c:8349:2:
../../../../src/include/varatt.h:230:36: warning: array subscript 0 is outside array bounds of 'char[0]' [-Warray-bounds=]
230 | (((varattrib_1b_e *) (PTR))->va_tag)
| ^
../../../../src/include/varatt.h:94:12: note: in definition of macro 'VARTAG_IS_EXPANDED'
94 | (((tag) & ~1) == VARTAG_EXPANDED_RO)
| ^~~
../../../../src/include/varatt.h:284:57: note: in expansion of macro 'VARTAG_1B_E'
284 | #define VARTAG_EXTERNAL(PTR) VARTAG_1B_E(PTR)
| ^~~~~~~~~~~
../../../../src/include/varatt.h:301:57: note: in expansion of macro 'VARTAG_EXTERNAL'
301 | (VARATT_IS_EXTERNAL(PTR) && !VARTAG_IS_EXPANDED(VARTAG_EXTERNAL(PTR)))
| ^~~~~~~~~~~~~~~
pl_exec.c:8537:17: note: in expansion of macro 'VARATT_IS_EXTERNAL_NON_EXPANDED'
8537 | VARATT_IS_EXTERNAL_NON_EXPANDED(DatumGetPointer(newvalue)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'exec_set_found':
cc1: note: source object is likely at address zero
view thread (5+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: pgsql: Add support event triggers on authenticated login
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox