pgsql: Suppress -Warray-bounds warning in 9.2's xlog.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Suppress -Warray-bounds warning in 9.2's xlog.c.
Date: 2021-12-13 16:57:36
Message-ID: E1mwods-0004qZ-3l@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Suppress -Warray-bounds warning in 9.2's xlog.c.

Late-model gcc delivers a confusing warning "'memcpy' offset [0, 63]
is out of the bounds [0, 0]" here, which turns out to be because it
thinks the "record" pointer might be NULL, which again is because
it doesn't know ereport(PANIC) won't return. The least invasive
way to fix that is to insert a couple of abort() calls. It's
surprising/fortunate that we don't have this issue in more places
... but this is the last remaining build warning with gcc 11.2.1,
so I'll settle for a narrow fix.

Discussion: https://postgr.es/m/d0316012-ece7-7b7e-2d36-9c38cb77cb3b@enterprisedb.com

Branch
------
REL9_2_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/985c8de212faa5a4c983005d4192fb7e543cf5ab

Modified Files
--------------
src/backend/access/transam/xlog.c | 4 ++++
1 file changed, 4 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2021-12-13 17:08:55 Re: pgsql: Check that we have a working tar before trying to use it
Previous Message Andrew Dunstan 2021-12-13 16:47:36 Re: pgsql: Check that we have a working tar before trying to use it