Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rO7he-001ZRN-Tu for pgsql-committers@arkaria.postgresql.org; Fri, 12 Jan 2024 02:55:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rO7he-00GqNt-2t for pgsql-committers@arkaria.postgresql.org; Fri, 12 Jan 2024 02:55:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rO7hd-00GqNl-SC for pgsql-committers@lists.postgresql.org; Fri, 12 Jan 2024 02:55:25 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rO7hb-0016xU-6S; Fri, 12 Jan 2024 02:55:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 40C2tJIK375044; Thu, 11 Jan 2024 21:55:19 -0500 From: Tom Lane To: Bharath Rupireddy cc: Alexander Korotkov , Andres Freund , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Add support event triggers on authenticated login In-reply-to: References: Comments: In-reply-to Bharath Rupireddy message dated "Fri, 12 Jan 2024 07:28:26 +0530" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <374427.1705028054.0@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 11 Jan 2024 21:55:19 -0500 Message-ID: <375043.1705028119@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="UTF-8" Content-ID: <374427.1705028054.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Bharath Rupireddy 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 ------- =_aaaaaaaaaa0 Content-Type: text/plain; name="gcc-13-2-1-warnings.txt"; charset="us-ascii" Content-ID: <374427.1705028054.2@sss.pgh.pa.us> Content-Description: gcc-13-2-1-warnings.txt Content-Transfer-Encoding: quoted-printable 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 'i= nstr_time[2][4][8]' [-Warray-bounds=3D] 149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_obj= ect][io_context][io_op], | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~= ~~~~ ../../../../src/include/portability/instr_time.h:179:11: note: in definiti= on of macro 'INSTR_TIME_ADD' 179 | ((x).ticks +=3D (y).ticks) | ^ pgstat_io.c:27:25: note: while referencing 'pending_times' 27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEX= T_NUM_TYPES][IOOP_NUM_TYPES]; | ^~~~~~~~~~~~~ pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'i= nstr_time[2][4][8]' [-Warray-bounds=3D] 149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_obj= ect][io_context][io_op], | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~= ~~~~ ../../../../src/include/portability/instr_time.h:179:11: note: in definiti= on of macro 'INSTR_TIME_ADD' 179 | ((x).ticks +=3D (y).ticks) | ^ pgstat_io.c:27:25: note: while referencing 'pending_times' 27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEX= T_NUM_TYPES][IOOP_NUM_TYPES]; | ^~~~~~~~~~~~~ pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'i= nstr_time[2][4][8]' [-Warray-bounds=3D] 149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_obj= ect][io_context][io_op], | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~= ~~~~ ../../../../src/include/portability/instr_time.h:179:11: note: in definiti= on of macro 'INSTR_TIME_ADD' 179 | ((x).ticks +=3D (y).ticks) | ^ pgstat_io.c:27:25: note: while referencing 'pending_times' 27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEX= T_NUM_TYPES][IOOP_NUM_TYPES]; | ^~~~~~~~~~~~~ pgstat_io.c:149:60: warning: array subscript 2 is above array bounds of 'i= nstr_time[2][4][8]' [-Warray-bounds=3D] 149 | INSTR_TIME_ADD(PendingIOStats.pending_times[io_obj= ect][io_context][io_op], | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~= ~~~~ ../../../../src/include/portability/instr_time.h:179:11: note: in definiti= on of macro 'INSTR_TIME_ADD' 179 | ((x).ticks +=3D (y).ticks) | ^ pgstat_io.c:27:25: note: while referencing 'pending_times' 27 | instr_time pending_times[IOOBJECT_NUM_TYPES][IOCONTEX= T_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 out= side array bounds of 'char[0]' [-Warray-bounds=3D] 230 | (((varattrib_1b_e *) (PTR))->va_tag) | ^ ../../../../src/include/varatt.h:94:12: note: in definition of macro 'VART= AG_IS_EXPANDED' 94 | (((tag) & ~1) =3D=3D VARTAG_EXPANDED_RO) | ^~~ ../../../../src/include/varatt.h:284:57: note: in expansion of macro 'VART= AG_1B_E' 284 | #define VARTAG_EXTERNAL(PTR) VARTAG_1B_= E(PTR) | ^~~~~~~~~~= ~ ../../../../src/include/varatt.h:301:57: note: in expansion of macro 'VART= AG_EXTERNAL' 301 | (VARATT_IS_EXTERNAL(PTR) && !VARTAG_IS_EXPANDED(VARTAG_EXT= ERNAL(PTR))) | ^~~~~~~~~~= ~~~~~ pl_exec.c:8537:17: note: in expansion of macro 'VARATT_IS_EXTERNAL_NON_EXP= ANDED' 8537 | VARATT_IS_EXTERNAL_NON_EXPANDED(DatumGetPointer(ne= wvalue))) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'exec_set_found': cc1: note: source object is likely at address zero ------- =_aaaaaaaaaa0--