Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* compiling with cxx 6.5-021
@ 2002-06-07 16:39 Angus Leeming
  0 siblings, 0 replies; only message in thread
From: Angus Leeming @ 2002-06-07 16:39 UTC (permalink / raw)


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 <utility>

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<T1, T2> 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<T1, T2> make_pair(T1 x, T2 y)
 #else
-  inline pair<T1, T2> make_pair(const T1& x, const T2& y)
+  pair<T1, T2> make_pair(const T1& x, const T2& y)
 #endif
   {
     return pair<T1, T2>(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<T, Allocator> &std::deque<T,
                      Allocator>::operator=(const std::deque<T, Allocator> &)
                      [with T=int, Allocator=std::allocator<int>]" 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 Controller, class GUIview>
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<ControlAboutlyx, FormAboutlyx>(*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 <class Base>
void ControlDialog<Base>::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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-07 16:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-07 16:39 compiling with cxx 6.5-021 Angus Leeming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox