gtk-3-24 build failure with GCC 11 [-Werror=array-bounds]
- Meson version:
0.56.2
- Project version:
3.24.27
(commit 5b0a1441)
- C compiler for the host machine: ccache cc (
gcc 11.0.0
"cc (GCC) 11.0.0 20210225 (Red Hat 11.0.0-0)")
- C linker for the host machine: cc ld.bfd 2.35.1-41
- Host machine cpu family:
x86_64
[554/1370] Compiling C object gtk/libgtk-3.so.0.2404.23.p/gtktextchild.c.o
FAILED: gtk/libgtk-3.so.0.2404.23.p/gtktextchild.c.o
ccache cc -Igtk/libgtk-3.so.0.2404.23.p -Igtk -I../gtk -I. -I.. -Igdk -I../gdk -Igdk/x11 -I../gdk/x11 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -DG_LOG_USE_STRUCTURED=1 -DGLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_56 -DGLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_58 '-DGTK_VERSION="3.24.27"' -D_GNU_SOURCE -DG_ENABLE_DEBUG -fPIC -pthread -DGTK_COMPILATION '-DG_LOG_DOMAIN="Gtk"' -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED '-DGTK_BINARY_VERSION="3.0.0"' '-DGTK_HOST="linux"' '-DGTK_DATA_PREFIX="/usr/local"' '-DGTK_LIBDIR="/usr/local/lib64"' '-DGTK_LOCALEDIR="/usr/local/share/locale"' '-DGTK_DATADIR="/usr/local/share"' '-DGTK_SYSCONFDIR="/usr/local/etc"' '-DX11_DATA_PREFIX="/usr"' -fno-strict-aliasing -Wpointer-arith -Wimplicit-function-declaration -Wformat=2 -Wformat-security -Wnested-externs -Wold-style-definition -Wundef -Wunused -Wcast-align -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-include-dirs -Wlogical-op -Wignored-qualifiers -Wno-discarded-qualifiers -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=empty-body -Werror=write-strings -fvisibility=hidden -MD -MQ gtk/libgtk-3.so.0.2404.23.p/gtktextchild.c.o -MF gtk/libgtk-3.so.0.2404.23.p/gtktextchild.c.o.d -o gtk/libgtk-3.so.0.2404.23.p/gtktextchild.c.o -c ../gtk/gtktextchild.c
../gtk/gtktextchild.c: In function ‘_gtk_pixbuf_segment_new’:
../gtk/gtktextchild.c:136:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
136 | seg->type = >k_text_pixbuf_type;
| ^~
../gtk/gtktextchild.c:134:9: note: referencing an object of size 32 allocated by ‘g_slice_alloc’
134 | seg = g_slice_alloc (PIXBUF_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:138:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
138 | seg->next = NULL;
| ^~
../gtk/gtktextchild.c:134:9: note: referencing an object of size 32 allocated by ‘g_slice_alloc’
134 | seg = g_slice_alloc (PIXBUF_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:143:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
143 | seg->byte_count = GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN;
| ^~
../gtk/gtktextchild.c:134:9: note: referencing an object of size 32 allocated by ‘g_slice_alloc’
134 | seg = g_slice_alloc (PIXBUF_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:144:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
144 | seg->char_count = 1;
| ^~
../gtk/gtktextchild.c:134:9: note: referencing an object of size 32 allocated by ‘g_slice_alloc’
134 | seg = g_slice_alloc (PIXBUF_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:146:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
146 | seg->body.pixbuf.pixbuf = pixbuf;
| ^~
../gtk/gtktextchild.c:134:9: note: referencing an object of size 32 allocated by ‘g_slice_alloc’
134 | seg = g_slice_alloc (PIXBUF_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c: In function ‘_gtk_widget_segment_new’:
../gtk/gtktextchild.c:231:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
231 | seg->type = >k_text_child_type;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:233:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
233 | seg->next = NULL;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:238:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
238 | seg->byte_count = GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:239:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
239 | seg->char_count = 1;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:241:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
241 | seg->body.child.obj = anchor;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:243:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
243 | seg->body.child.widgets = NULL;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:244:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
244 | seg->body.child.tree = NULL;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextchild.c:245:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[56]’ [-Werror=array-bounds]
245 | seg->body.child.line = NULL;
| ^~
../gtk/gtktextchild.c:229:9: note: referencing an object of size 56 allocated by ‘g_slice_alloc’
229 | seg = g_slice_alloc (WIDGET_SEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
[555/1370] Compiling C object gtk/libgtk-3.so.0.2404.23.p/gtktextsegment.c.o
FAILED: gtk/libgtk-3.so.0.2404.23.p/gtktextsegment.c.o
ccache cc -Igtk/libgtk-3.so.0.2404.23.p -Igtk -I../gtk -I. -I.. -Igdk -I../gdk -Igdk/x11 -I../gdk/x11 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -DG_LOG_USE_STRUCTURED=1 -DGLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_56 -DGLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_58 '-DGTK_VERSION="3.24.27"' -D_GNU_SOURCE -DG_ENABLE_DEBUG -fPIC -pthread -DGTK_COMPILATION '-DG_LOG_DOMAIN="Gtk"' -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED '-DGTK_BINARY_VERSION="3.0.0"' '-DGTK_HOST="linux"' '-DGTK_DATA_PREFIX="/usr/local"' '-DGTK_LIBDIR="/usr/local/lib64"' '-DGTK_LOCALEDIR="/usr/local/share/locale"' '-DGTK_DATADIR="/usr/local/share"' '-DGTK_SYSCONFDIR="/usr/local/etc"' '-DX11_DATA_PREFIX="/usr"' -fno-strict-aliasing -Wpointer-arith -Wimplicit-function-declaration -Wformat=2 -Wformat-security -Wnested-externs -Wold-style-definition -Wundef -Wunused -Wcast-align -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-include-dirs -Wlogical-op -Wignored-qualifiers -Wno-discarded-qualifiers -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=empty-body -Werror=write-strings -fvisibility=hidden -MD -MQ gtk/libgtk-3.so.0.2404.23.p/gtktextsegment.c.o -MF gtk/libgtk-3.so.0.2404.23.p/gtktextsegment.c.o.d -o gtk/libgtk-3.so.0.2404.23.p/gtktextsegment.c.o -c ../gtk/gtktextsegment.c
../gtk/gtktextsegment.c: In function ‘_gtk_toggle_segment_new’:
../gtk/gtktextsegment.c:433:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[40]’ [-Werror=array-bounds]
433 | seg->type = on ? >k_text_toggle_on_type : >k_text_toggle_off_type;
| ^~
../gtk/gtktextsegment.c:431:9: note: referencing an object of size 40 allocated by ‘g_slice_alloc’
431 | seg = g_slice_alloc (TSEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextsegment.c:435:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[40]’ [-Werror=array-bounds]
435 | seg->next = NULL;
| ^~
../gtk/gtktextsegment.c:431:9: note: referencing an object of size 40 allocated by ‘g_slice_alloc’
431 | seg = g_slice_alloc (TSEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextsegment.c:437:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[40]’ [-Werror=array-bounds]
437 | seg->byte_count = 0;
| ^~
../gtk/gtktextsegment.c:431:9: note: referencing an object of size 40 allocated by ‘g_slice_alloc’
431 | seg = g_slice_alloc (TSEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextsegment.c:438:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[40]’ [-Werror=array-bounds]
438 | seg->char_count = 0;
| ^~
../gtk/gtktextsegment.c:431:9: note: referencing an object of size 40 allocated by ‘g_slice_alloc’
431 | seg = g_slice_alloc (TSEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextsegment.c:440:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[40]’ [-Werror=array-bounds]
440 | seg->body.toggle.info = info;
| ^~
../gtk/gtktextsegment.c:431:9: note: referencing an object of size 40 allocated by ‘g_slice_alloc’
431 | seg = g_slice_alloc (TSEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../gtk/gtktextsegment.c:441:6: error: array subscript ‘GtkTextLineSegment {aka struct _GtkTextLineSegment}[0]’ is partly outside array bounds of ‘unsigned char[40]’ [-Werror=array-bounds]
441 | seg->body.toggle.inNodeCounts = 0;
| ^~
../gtk/gtktextsegment.c:431:9: note: referencing an object of size 40 allocated by ‘g_slice_alloc’
431 | seg = g_slice_alloc (TSEG_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
[568/1370] Compiling C object gtk/libgtk-3.so.0.2404.23.p/gtktreestore.c.o
../gtk/gtktreestore.c: In function ‘gtk_tree_store_move’:
../gtk/gtktreestore.c:2637:13: warning: ‘dst_b.user_data’ may be used uninitialized [-Wmaybe-uninitialized]
2637 | b = G_NODE (dst_b.user_data);
| ^
../gtk/gtktreestore.c:2500:35: note: ‘dst_b’ declared here
2500 | GtkTreeIter parent_iter, dst_a, dst_b;
| ^~~~~
[571/1370] Compiling C object gtk/libgtk-3.so.0.2404.23.p/gtktreeview.c.o
ninja: build stopped: subcommand failed.