Issue 456 - cannot build: xml2cmp/source/xmldata/cmp_xml.c on IRIX
Summary: cannot build: xml2cmp/source/xmldata/cmp_xml.c on IRIX
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: documentation (show other issues)
Version: 619
Hardware: SGI IRIX
: P2 Trivial (vote)
Target Milestone: ---
Assignee: issues@www
QA Contact: issues@www
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-02-21 16:16 UTC by issues@www
Modified: 2007-06-25 22:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description issues@www 2001-02-21 16:16:25 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.
Comment 1 issues@www 2001-03-12 21:19:18 UTC
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).
Comment 2 sander_traveling 2001-03-12 21:37:37 UTC
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...
Comment 3 issues@www 2001-03-12 22:26:59 UTC
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.
Comment 4 joerg.barfurth 2001-03-13 08:40:56 UTC
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.
Comment 5 nikolai.pretzell 2001-03-13 11:44:26 UTC
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).
Comment 6 issues@www 2001-03-13 12:32:07 UTC
The 1.3 cmp_xml.c file seems to compile now. Thanks.
Comment 7 Martin Hollmichel 2007-06-25 22:39:32 UTC
close issue.