From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,a58b62461a798a1d,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-06-07 09:45:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!newshub.sdsu.edu!west.cox.net!cox.net!newspeer1-gui.server.ntli.net!ntli.net!server4.netnews.ja.net!jura.cc.ic.ac.uk!not-for-mail From: Angus Leeming Newsgroups: comp.unix.tru64 Subject: compiling with cxx 6.5-021 Date: Fri, 07 Jun 2002 17:39:47 +0100 Organization: Imperial College Message-ID: NNTP-Posting-Host: pneumon.bg.ic.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: jura.cc.ic.ac.uk 1023467819 18433 155.198.83.66 (7 Jun 2002 16:36:59 GMT) X-Complaints-To: usenet@jura.cc.ic.ac.uk NNTP-Posting-Date: 7 Jun 2002 16:36:59 GMT User-Agent: KNode/0.6.1 Xref: archiver1.google.com comp.unix.tru64:7891 Hello. I have recently installed cxx 6.5-021 on a machine running Tru64 Unix 4.0e. I have managed to compile a large OS project, LyX, with it without too much difficulty, but find I have had to make some changes to the cxx header files and, in a couple of cases, "odd" changes to the LyX source files. It has been suggested that I post my findings here, so here goes! I have been compiling with -std strict_ansi PROBLEM 1 ========= I have found that the headers in cxx_cname are very incomplete, but patching them by hand seems to work fine. If you'd like the patch, then feel free to ask ;-) PROBLEM 2 ========= I have found a possible compiler bug triggered by the make_pair declaration in cxx: Error: /usr/lib/cmplrs/cxx/V6.5-021/include/cxx/utility, line 197: extern inline function "std::make_pair(const T1 &, const T2 &) [with T1=std::string, T2=std::string]" was referenced but not defined inline pair make_pair(const T1& x, const T2& y) ----------------------^ Removing the "inline" from the declaration fixed that. --- /usr/include/cxx/utility_safe Mon Apr 29 22:16:33 2002 +++ /usr/include/cxx/utility Mon Apr 29 22:16:00 2002 @@ -194,7 +194,7 @@ #if defined(__DECCXX) && defined(__MODEL_ANSI) && !defined(__DECFIXCXXL1627) inline pair make_pair(T1 x, T2 y) #else - inline pair make_pair(const T1& x, const T2& y) + pair make_pair(const T1& x, const T2& y) #endif { return pair(x, y); PROBLEM 3 ========= I had a problem with std::deque's operator=(). cxx: Error: /usr/lib/cmplrs/cxx/V6.5-021/include/cxx/deque, line 574: #468 a template argument may not reference a local type detected during: instantiation of "std::deque &std::deque::operator=(const std::deque &) [with T=int, Allocator=std::allocator]" at line 936 of "../../../../devel/src/frontends/xforms/FormPreferences.C" copy(x.begin() + size(), x.end(), ----------^ I fixed that with the following patch: --- /usr/include/cxx/deque_safe Mon Apr 29 22:16:33 2002 +++ /usr/include/cxx/deque Mon Apr 29 22:16:00 2002 @@ -570,9 +570,11 @@ { if (size() >= x.size()) erase(copy(x.begin(), x.end(), begin()), end()); - else - copy(x.begin() + size(), x.end(), - inserter(*this,copy(x.begin(),x.begin()+size(),begin()))); + else { + const_iterator mid = x.begin() + difference_type(size()); + copy(x.begin(), mid, begin()); + insert(end(), mid, x.end()); + } } return *this; } which is exactly what GNU's gcc-3.1 does here. PROBLEM 4 ========= Something very similar to this code snippet leads to the linker complaining about being unable to find ControllerBase::view(), a pure abstract method! class ControllerBase { public: virtual ViewBase & view() = 0; }; template class GUI : public Controller { public: /// GUI(LyXView & lv, Dialogs & d) : Controller(lv, d), view_(*this) {} /// virtual ViewBase & view() { return view_; } private: /// GUIview view_; }; Dialogs::Dialogs(LyXView & lv) { add(new GUI(*lv, *this)); } I fudged things by defining ViewBase & ControllerBase::view() {} in ControllerBase.C PROBLEM 5 ========= I have had to prefix base class methods with Base:: This occurs only in templatised classes, like so: template void ControlDialog::show() { if (Base::isBufferDependent() && !Base::lv_.view()->available()) return; Base::connect(); ... } Are any of these problems fixed by Wednesday's release of cxx 6.5-026? If not, then I hope that the bug report proves to be useful. Best regards, Angus