summaryrefslogtreecommitdiff
path: root/gtk/gtktextsegment.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtktextsegment.c')
-rw-r--r--gtk/gtktextsegment.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtktextsegment.c b/gtk/gtktextsegment.c
index a202ab603c..0680b73cfa 100644
--- a/gtk/gtktextsegment.c
+++ b/gtk/gtktextsegment.c
@@ -425,6 +425,12 @@ char_segment_check_func (GtkTextLineSegment *segPtr, GtkTextLine *line)
GtkTextLineSegment*
_gtk_toggle_segment_new (GtkTextTagInfo *info, gboolean on)
{
+ /* gcc-11 issues a diagnostic here because the size allocated
+ for SEG does not cover the entire size of a GtkTextLineSegment
+ and gcc has no way to know that the union will only be used
+ for limited types and the additional space is not needed. */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
GtkTextLineSegment *seg;
seg = g_slice_alloc (TSEG_SIZE);
@@ -440,6 +446,7 @@ _gtk_toggle_segment_new (GtkTextTagInfo *info, gboolean on)
seg->body.toggle.inNodeCounts = 0;
return seg;
+#pragma GCC diagnostic pop
}
void