Apache OpenOffice (AOO) Bugzilla – Issue 456
cannot build: xml2cmp/source/xmldata/cmp_xml.c on IRIX
Last modified: 2007-06-25 22:39:32 UTC
I get these errors: cc -KPIC -c -n32 -I. -I. -I../inc -I../../inc -I../../unx/inc -I../../unxirxm3.pro/inc -I. -I/test/k/oo_619_src/solver/619/unxirxm3.pro/inc -I/test/k/oo_619_src/solver/619/unxirxm3.pro/inc/external -I/test/k/oo_619_src/solenv/unxirxm3/inc -I/test/k/oo_619_src/solenv/inc -I/test/k/oo_619_src/res -I/usr/include -I/usr/dsk/tmp/k/STLport-4.1b4/port -I/test/k/oo_619_src/solenv/inc/Xp31 -I/include -I/include/irix -I/include/native_threads/include -I/usr/include -I/usr/include -I. -I../../res -I. -DVCL -D_PTHREADS -D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE -O -Xcpluscomm -woff 1009,1021,1107,1110,1155,1171,1183,1185,1188,1233,1234,1257,1440,1516,1681,1682 -DIRIX -DUNX -DVCL -DC730 -DC730 -DMIPS -DTF_UCB -DENABLEUNICODE -DTF_SDBAPI -DTF_FILTER -DCVER=C730 -D__DMAKE -DUNIX -DSUPD=619 -DBUILD=6103 -DSOLAR_PLUGIN -DVCL -DSO3 -DPRODUCT -DNDEBUG -DPRODUCT_FULL -DOPTIMIZE -DCUI -DSRC619 -DTF_ONE51 -DMULTITHREAD -o ../../unxirxm3.pro/obj/cmp_xml.o cmp_xml.c "cmp_xml.c", line 269: error(1515): a value of type "int" cannot be assigned to an entity of type "struct dirent *" while ( pEntry = readdir(pDir) != 0 ) "cmp_xml.c", line 349: error(1515): a value of type "int" cannot be assigned to an entity of type "struct dirent *" while ( pEntry = readdir(pDir) != 0 ) I don't know enough about programming to fix this.
I believe IRIX is unusual in that it returns a struct dirent from readdir (or maybe it's not that unusual). Anyway, it's trying to compare a (struct dirent *) to an integer (0). I suggest changing it from: while ( pEntry = readdir(pDir) != 0 ) to the following: while ( pEntry = readdir(pDir) != (struct dirent *)NULL ) in both cases; or specialcase it out for IRIX: while ( pEntry = readdir(pDir) != #ifdef IRIX (struct dirent *)NULL #else 0 #endif ) although I think this is unnecessary. In any case, please change it to while ( pEntry = readdir(pDir) != (struct dirent *)NULL ) and let us know if it compiles (I'm just pitching in here; I don't know where our build area is internally or externally).
Ok, I'm assigning this to you as I don't have any irix machines at hand. Also, please use rev 1.2 of thart file (it is in OO619B) esp. when submitting patches...
I'd like to take this but I currently am sort of lurking. I don't have a build environment, cvs loaded, the problem code, etc. So I'm sending this back to ktaylor to try out my change and see if it gets you past the problem point. At some point, this change should be merged into the main source base.
Hi, I just stumbled on this in a bugmail-list and I'd like to add a remark. To me it looks as if this is not IRIX-specific at all - it should not compile under any *NIX. The line while ( pEntry = readdir(pDir) != 0 ) is parsed as while ( pEntry = (readdir(pDir) != 0) ) and tries to assign a bool (C++) or int (C) to a pointer -> ERROR. I assume the intent was: while ( (pEntry = readdir(pDir)) != 0 ) which needs the parens.
Joerg Barfurth was right with his interpretation. The bug with missing brackets in while ( pEntry = readdir(pDir) != 0 ) was seen and fixed in the new version of xml2cmp, which also consists of a completely new set of source files. Until the next milestone you will have to live with cmp_xml.c - so I have changed that file today - just get it toplevel from cvs (revision 1.3).
The 1.3 cmp_xml.c file seems to compile now. Thanks.
close issue.