I figured it had to be something like that, and that had it been serious, it would have 1) been an error rather than a warning, 2) blown up at some point and/or 3) been done differently in the first place.
I don't know whether the warning occurs if you build the DLL version. I, too, would be surprised if it didn't, unless the stock makefile suppresses the warning with /wd4355. -----Original Message----- From: Mark Weaver [mailto:mark@;npsl.co.uk] Sent: Thursday, October 24, 2002 2:20 PM To: [EMAIL PROTECTED] Subject: RE: compiling xerces into a static library #pragma warning (disable: 4355) :) I'm surprised that you don't get this warning regardless of static compilation. It means that you are passing 'this' to a member during construction. The problem is that 'this' has not been fully constructed, so you could get explosions; e.g. class Y; class X { public: X(Y* y) { y->die(); } }; class Y { public: Y() : m_x(this), m_s("foobar") {} void die() { std::cout << m_s; } private: X m_x; const char *m_s; }; here X attempts to use the unconstructed Y. This will cause undefined behaviour. It's not actually illegal to do this however, as if X just stores a pointer to Y, and does not use it until after construction is complete, then it works. Mark > -----Original Message----- > From: Jesse Pelton [mailto:jsp@;PKC.com] > Sent: 24 October 2002 18:45 > To: '[EMAIL PROTECTED]' > Subject: RE: compiling xerces into a static library > > > I build a static Xerces library using VC 7. (Did it with VC 6, too, but > we've moved on.) I haven't encountered any problems. I haven't made the > effort to understand the warnings, preferring blissful ignorance. > > -----Original Message----- > From: Martin Bosticky [mailto:mbosticky@;aimltd.co.uk] > Sent: Thursday, October 24, 2002 9:19 AM > To: [EMAIL PROTECTED] > Subject: compiling xerces into a static library > > > Hi. > > I have compiled xerces into a static library on VC6 since I wanted to > add an XML parser but didn't want to carry the distribution overhead > needs > > Is such practice discouraged? I nave noticed I got extra 8 warnings when > compiling it and well, I am not sure if that would make the library > unstable when compiled that way. > > The lib ends up 24 MB (release) and massive 41 MB in debug and after > compile with my originally 384 Kb application becomes about 4MB in Debug > and 156KB in release becomes 1.4MB which is kind of reasonable I > suppose. > > Any comments on this kind of compiling strategy are welcome. > > > > By the way, I got these warnings when compiling the static library > xerces and they could be because I have only guessed at the appropriate > settings: > > xercesc\dom\impl\DOMDocumentImpl.cpp(108) : warning C4355: 'this' : used > in base member initializer list > xercesc\dom\impl\DOMDocumentImpl.cpp(109) : warning C4355: 'this' : used > in base member initializer list > xercesc\dom\impl\DOMDocumentImpl.cpp(138) : warning C4355: 'this' : used > in base member initializer list > xercesc\dom\impl\DOMDocumentImpl.cpp(139) : warning C4355: 'this' : used > in base member initializer list > > xercesc\dom\impl\DOMParentNode.cpp(73) : warning C4355: 'this' : used in > base member initializer list > xercesc\dom\impl\DOMParentNode.cpp(81) : warning C4355: 'this' : used in > base member initializer list > > xercesc\dom\deprecated\DocumentImpl.cpp(99) : warning C4355: 'this' : > used in base member initializer list > xercesc\dom\deprecated\DocumentImpl.cpp(118) : warning C4355: 'this' : > used in base member initializer list > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
