Build failure w/ gcc-5.1 and -O3 optimization level
Submitted by pet..@..il.com
Assigned to Xorg Project Team
Description
When building xorg-server 1.17.1 or 1.17.2 on Arch Linux (up-to-date, rolling release) with gcc 5.1 the build fails with:
xvdisp.c: In function ‘XineramifyXv’: xvdisp.c:1783:37: error: array subscript is above array bounds [-Werror=array-bounds] if (MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) ^ xvdisp.c:1784:31: error: array subscript is above array bounds [-Werror=array-bounds] port->info[k].id = MatchingAdaptors[k]->base_id + j; ^ xvdisp.c:1786:31: error: array subscript is above array bounds [-Werror=array-bounds] port->info[k].id = 0; ^ cc1: some warnings being treated as errors Makefile:777: recipe for target 'xvdisp.lo' failed
The build completes successfully with gcc-5.1 and -O2 optimization level. With gcc-4.9 and -O3 this did not happen.