maprules.c:1095: error: array subscript is not an integer

Jeremy C. Reed reed at reedmedia.net
Wed May 24 10:09:10 PDT 2006


Building xorg-server-1.1.0 on NetBSD 3.99.18 fails here:

 cc -DHAVE_CONFIG_H -I. -I../include 
-I/home/packages/tmp-pkgsrc/wip/xorg-server/work.glacier/.buildlink/include 
-I/home/packages/tmp-pkgsrc/wip/xorg-server/work.glacier/.buildlink/include/freetype2 
-DHAVE_DIX_CONFIG_H -DXFree86Server -DXFree86LOADER -DHAVE_XKB_CONFIG_H 
-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing -D_BSD_SOURCE 
-DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I../Xext -I../composite -I../damageext 
-I../xfixes -I../Xi -I../mi -I../miext/shadow -I../miext/damage 
-I../render -I../randr -I../fb -O2 -MT maprules.lo -MD -MP -MF 
.deps/maprules.Tpo -c maprules.c -fPIC -DPIC -o .libs/maprules.o
maprules.c: In function `XkbRF_LoadDescriptions':
maprules.c:1095: error: array subscript is not an integer
maprules.c:1142: warning: subscript has type `char'
*** Error code 1

Stop.
make: stopped in 
/home/packages/tmp-pkgsrc/wip/xorg-server/work.glacier/xorg-ser
ver-1.1.0/xkb
*** Error code 1


>From the commit logs, I see this code has been changed a couple times. 
First it changed to strcmp with the tolower and then it removed the 
tolower for a few but not this one.

My fix is:

--- maprules.c.orig	2006-05-24 09:50:09.000000000 -0700
+++ maprules.c	2006-05-24 10:05:22.000000000 -0700
@@ -1092,7 +1092,7 @@
     for ( ; GetInputLine(file,&line,False); line.num_line= 0) {
 	if (line.line[0]=='!') {
 	    tok = strtok(&(line.line[1]), " \t");
-	    if (_XkbStrCaseCmp(tolower(tok),"model") == 0)
+	    if (_XkbStrCaseCmp(tok,"model") == 0)
 		headingtype = HEAD_MODEL;
 	    else if (_XkbStrCaseCmp(tok,"layout") == 0)
 		headingtype = HEAD_LAYOUT;


Okay to commit? (Was this an oversight? Or is it supposed to be this 
way?) This is untested, but this builds now.


 Jeremy C. Reed

echo '9,J8HD,fDGG8B@?:536FC5=8 at I;C5?@H5B0D at 5GBIELD54DL>@8L?:5GDEJ8LDG1' |\
sed ss,s50EBsg | tr 0-M 'p.wBt SgiIlxmLhan:o,erDsduv/cyP'



More information about the xorg mailing list