<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [igt] new compilation error with GCC 9"
href="https://bugs.freedesktop.org/show_bug.cgi?id=109257">109257</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[igt] new compilation error with GCC 9
</td>
</tr>
<tr>
<th>Product</th>
<td>DRI
</td>
</tr>
<tr>
<th>Version</th>
<td>XOrg git
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>DRM/Intel
</td>
</tr>
<tr>
<th>Assignee</th>
<td>intel-gfx-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mliska@suse.cz
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>intel-gfx-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>CC</th>
<td>intel-gfx-bugs@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>I see following error:
igt_fb.c:1382:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
1382 | rgb->d[0] = rgb24[2];
| ~~~~~~~~~~^~~~~~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
1549 | struct igt_vec4 rgb[2];
| ^~~
igt_fb.c:1383:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
1383 | rgb->d[1] = rgb24[1];
| ~~~~~~~~~~^~~~~~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
1549 | struct igt_vec4 rgb[2];
| ^~~
igt_fb.c:1384:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
1384 | rgb->d[2] = rgb24[0];
| ~~~~~~~~~~^~~~~~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
1549 | struct igt_vec4 rgb[2];
| ^~~
igt_fb.c:1385:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
1385 | rgb->d[3] = 1.0f;
| ~~~~~~~~~~^~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
1549 | struct igt_vec4 rgb[2];
| ^~~
I guess it's a typo and should be fixed by:
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 8244e517..5cd1829a 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1779,7 +1779,7 @@ static void convert_rgb24_to_nv12(struct fb_convert *cvt)
struct igt_vec4 yuv[2];
read_rgb(&rgb[0], &rgb24[j * 8 + 0]);
- read_rgb(&rgb[2], &rgb24[j * 8 + 0 + rgb24_stride]);
+ read_rgb(&rgb[1], &rgb24[j * 8 + 0 + rgb24_stride]);
yuv[0] = igt_matrix_transform(&m, &rgb[0]);
yuv[1] = igt_matrix_transform(&m, &rgb[1]);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are the QA Contact for the bug.</li>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>