pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: bufmgr: Avoid spurious compiler warning after fcb9c977aa5
Date: Fri, 16 Jan 2026 12:02:29 +0000
Message-ID: <E1vgiX7-000nIC-0X@gemulon.postgresql.org> (raw)

bufmgr: Avoid spurious compiler warning after fcb9c977aa5

Some compilers, e.g. gcc with -Og or -O1, warn about the wait_event in
BufferLockAcquire() possibly being uninitialized. That can't actually happen,
as the switch() covers all legal lock mode values, but we still need to
silence the warning.  We could add a default:, but we'd like to get a warning
if we were to get a new lock mode in the future.  So just initialize
wait_event to 0.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/934395.1768518154@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/84705b37273da016633fc5c0a06e848bd6e1e71b

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Message-ID: <E1vgiX7-000nIC-0X@gemulon.postgresql.org>
Permalink:  ../E1vgiX7-000nIC-0X@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vgiX7-000nIC-0X@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: bufmgr: Avoid spurious compiler warning after fcb9c977aa5
  In-Reply-To: <E1vgiX7-000nIC-0X@gemulon.postgresql.org>

* 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