[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-0.0.9 : some C++ issues



On 12 May 1998, Laurent Bonnaud wrote:

> first i would like to thank you all for this very nice program,
> especially since it includes FTP support !  I have only one regret: the
> graphical utility was removed because it was not very functional.
> However i found that it was very nice for demos and in order to see all
> broken packages at a glance.  Thefore i would very much welcome its
> reintroduction into the apt package.

It should go back into experimental sometime after this thing goes into
slink.. 
 
> Now here is a small contribution.  As you know, the future egcs 1.1
> compiler will be even closer to the C++ standard than 1.0.2.  Among
> other things it will have namespaces and probably a template based
> iostream.  So i tried to check apt with another very good compiler
> (KCC) and found some problems :
 
Hm, unfortunately I don't have any up-to-date C++ compilers to test
against, all the conforming ones I have access to run on windows.
 
>  - namespace support : for exemple in basic.h <string> is included, but
>    it belongs to the std namespace.  It still compiles with egcs but
>    not with KCC.  One quick fix (working with egcs-1.0.2 too) would be
> 
> #include <string>
> using namespace std;

Hm, that seems awefully weird, I haven't read through the spec yet on the
namespace stuff mind you. Is it necessary to put using namespace std in
every single C file? Presumably the headers should have something like
using namespace std { <stuff> }; around them too.. Ik.

For testing what I would do is to create a file called string in include
or build/include and put in it
#include </..../string>
using namespace std;

Pretty much every module uses string :<

>  - templated iostream : for instance in graphics.h there is:
> 
> class ostream;
> 
> This wil not work with templated iostream.  Instead you should use
> 
> #include <iosfwd>
> 
> which works in both cases.

Ah, I'll just include iostream.h then, I do hate bringing in such a huge
header just for the ostream prototype though :<
 
>  - default arguments should only appear in the declaration of a
>    function, not in the definition.  For exemple, in columnbar.h there
>    is
> 
> class ColumnBar : public BasicWidget
> {
>    ColumnBar(string Columns,Widget *Parent = 0);
> };
> 
> and in columnbar.cc
> 
>  ColumnBar::ColumnBar(string Columns,Widget *Parent = 0)
> 
> should be 
> 
>  ColumnBar::ColumnBar(string Columns,Widget *Parent)

This is a glitch, I'm amazed g++ didn't flag it.
 
>  - here is another random error:
> 
> "deity/graphics.h", line 304: error: duplicate parameter name
>      virtual void DrawBitmap(Rect Pos,Point Pos,XPMImage &Image,unsigned long Flags = 0) = 0;

Ditto
 
> I could not go much further as apt is still very difficult to build,
> even on a hamm system, and i did my tests on Solaris.

The best way to build it is to make a source tar.gz using the setup.build
script and then tar it up with the option to follow symlinks. That gets
all the libtool and automake stuff as well.

You'll probably have to do some deep magic to get it to compile on
something other that gcc, possibly just ifdef out all of templates.cc..

Thanks,
Jason


--
To UNSUBSCRIBE, email to deity-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: