You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2003/06/10 13:01:48 UTC
DO NOT REPLY [Bug 20642] New: -
Lack of ctor definitions in XMemory prevents build on VC++ 7.0 with WPO enabled
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20642>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20642
Lack of ctor definitions in XMemory prevents build on VC++ 7.0 with WPO enabled
Summary: Lack of ctor definitions in XMemory prevents build on
VC++ 7.0 with WPO enabled
Product: Xerces-C++
Version: 2.3.0
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Normal
Priority: Other
Component: Utilities
AssignedTo: xerces-c-dev@xml.apache.org
ReportedBy: carbe771@student.liu.se
In XMemory.hpp two constructors (copy and assignment) have been marked as private/unimplemented:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XMemory(const XMemory&);
XMemory& operator=(const XMemory&);
No definition can be found in the corresponding CPP file. Most compilers will (and should) probably not care, since these constructors will never be used. Nevertheless, the lack of a definition causes VC++ 7.0 to emit a linker error when its Whole Program Optimization feature, WPO, is enabled (and I want to use WPO to achieve optimal performance).
The error can be resolved by providing a dummy inline definition in the header file (or perhaps in the implementation file), like this:
XMemory(const XMemory&) { /* Not implemented */ }
XMemory& operator=(const XMemory&) { /* Not implemented */ return *this; }
You might want to add an "assert(false);" in both methods in order to make sure any accidental use will not go undetected.
Cheers!
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org