gcc-14.1.0 [-Werror=array-bounds=] meson buildtype=release compile error

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: gcc-14.1.0 [-Werror=array-bounds=] meson buildtype=release compile error
Date: 2024-10-11 09:18:00
Message-ID: CACJufxGyTmMxOAHbatTy-K93eORuz7kvOr7z0daD6=SBada2gQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, meson buildtype=release works fine.
gcc-14.1.0 meson buildtype=debug works fines

but the $SUBJECT error occurred.
my system: ubuntu1~22.04

[1409/1982] Compiling C object src/pl/plpgsql/src/plpgsql.so.p/pl_exec.c.o
FAILED: src/pl/plpgsql/src/plpgsql.so.p/pl_exec.c.o
/usr/local/gcc-14.1.0/bin/gcc-14.1.0 -Isrc/pl/plpgsql/src/plpgsql.so.p
-Isrc/pl/plpgsql/src
-I../../Desktop/pg_src/src8/postgres/src/pl/plpgsql/src -Isrc/include
-I../../Desktop/pg_src/src8/postgres/src/include
-I/usr/include/libxml2 -fdiagnostics-color=always --coverage
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O3 -g
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_GNU_SOURCE
-Wmissing-prototypes -Wpointer-arith -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wimplicit-fallthrough=3
-Wcast-function-type -Wshadow=compatible-local -Wformat-security
-Wdeclaration-after-statement -Wmissing-variable-declarations
-Wno-format-truncation -Wno-stringop-truncation -Wunused-variable
-Wuninitialized -Werror=maybe-uninitialized -Wreturn-type
-DWRITE_READ_PARSE_PLAN_TREES -DCOPY_PARSE_PLAN_TREES
-DREALLOCATE_BITMAPSETS -DLOCK_DEBUG
-DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
-DRAW_EXPRESSION_COVERAGE_TEST -fno-omit-frame-pointer -fPIC -pthread
-fvisibility=hidden -MD -MQ
src/pl/plpgsql/src/plpgsql.so.p/pl_exec.c.o -MF
src/pl/plpgsql/src/plpgsql.so.p/pl_exec.c.o.d -o
src/pl/plpgsql/src/plpgsql.so.p/pl_exec.c.o -c
../../Desktop/pg_src/src8/postgres/src/pl/plpgsql/src/pl_exec.c
In file included from
../../Desktop/pg_src/src8/postgres/src/include/access/htup_details.h:22,
from
../../Desktop/pg_src/src8/postgres/src/pl/plpgsql/src/pl_exec.c:21:
In function ‘assign_simple_var’,
inlined from ‘exec_set_found’ at
../../Desktop/pg_src/src8/postgres/src/pl/plpgsql/src/pl_exec.c:8384:2:
../../Desktop/pg_src/src8/postgres/src/include/varatt.h:230:36: error:
array subscript 0 is outside array bounds of ‘char[0]’
[-Werror=array-bounds=]
230 | (((varattrib_1b_e *) (PTR))->va_tag)
| ^
../../Desktop/pg_src/src8/postgres/src/include/varatt.h:94:12: note:
in definition of macro ‘VARTAG_IS_EXPANDED’
94 | (((tag) & ~1) == VARTAG_EXPANDED_RO)
| ^~~
../../Desktop/pg_src/src8/postgres/src/include/varatt.h:284:57: note:
in expansion of macro ‘VARTAG_1B_E’
284 | #define VARTAG_EXTERNAL(PTR) VARTAG_1B_E(PTR)
| ^~~~~~~~~~~
../../Desktop/pg_src/src8/postgres/src/include/varatt.h:301:57: note:
in expansion of macro ‘VARTAG_EXTERNAL’
301 | (VARATT_IS_EXTERNAL(PTR) &&
!VARTAG_IS_EXPANDED(VARTAG_EXTERNAL(PTR)))
| ^~~~~~~~~~~~~~~
../../Desktop/pg_src/src8/postgres/src/pl/plpgsql/src/pl_exec.c:8572:17:
note: in expansion of macro ‘VARATT_IS_EXTERNAL_NON_EXPANDED’
8572 |
VARATT_IS_EXTERNAL_NON_EXPANDED(DatumGetPointer(newvalue)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘exec_set_found’:
cc1: note: source object is likely at address zero
cc1: all warnings being treated as errors
[1419/1982] Compiling C object src/bin/pg_dump/pg_dump.p/pg_dump.c.o

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2024-10-11 09:23:17 Re: gcc-14.1.0 [-Werror=array-bounds=] meson buildtype=release compile error
Previous Message Zhijie Hou (Fujitsu) 2024-10-11 08:34:42 RE: Conflict detection for update_deleted in logical replication