builderror xorg-server-1.11.4 with gcc-4.7.0

Alan Coopersmith alan.coopersmith at oracle.com
Thu Mar 29 13:04:37 PDT 2012


On 03/29/12 12:41 PM, Stephan Raue wrote:
> Hi,
> 
> building xorg-server-1.11.4 with gcc-4.7.0 gives me follow error:
> 
> 
> main.c: In function 'main':
> main.c:138:13: warning: assignment discards 'const' qualifier from pointer
> target type [enabled by default]
> main.c:171:10: error: array subscript is outside array bounds
> [-Werror=array-bounds]
> main.c:171:10: error: array subscript is outside array bounds
> [-Werror=array-bounds]
> main.c:171:10: error: array subscript is outside array bounds
> [-Werror=array-bounds]
> main.c:171:10: error: array subscript is outside array bounds
> [-Werror=array-bounds]
> main.c:171:10: error: array subscript is outside array bounds
> [-Werror=array-bounds]
> main.c:171:10: error: array subscript is outside array bounds
> [-Werror=array-bounds]
> cc1: some warnings being treated as errors

Seems like a bug in your brand new compiler, since the code appears correct.

http://cgit.freedesktop.org/xorg/xserver/tree/dix/main.c?id=xorg-server-1.11.4#n167

shows the code in question is:

	    for (i=1; i<MAXCLIENTS; i++)
		clients[i] = NullClient;

and include/dix.h defines that array as:

extern _X_EXPORT ClientPtr clients[MAXCLIENTS];

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc



More information about the xorg mailing list