Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Michael on February 01, 2006, 07:17:14 pm

Title: Building C::B with GCC 4.1.0
Post by: Michael on February 01, 2006, 07:17:14 pm
Hello,

I have tried to compile C::B + contrib. plugins with GCC 4.1.0 (from Ceniza) and it worked quite well :D. I got a lot of warnings regarding wxWidgets (I think that Ceniza said already something about this). Especially of this type:

Quote
wx/include/wx/string.h:58: warning: type attributes are honored only at type definition

C::B had some of these too.

Several warnings of this type too:

Quote
sdk/propgrid/include/wx/propgrid/propgrid.h:2352: warning: 'class wxPropertyContainerMethods' has virtual functions but non-virtual destructor

Some of this type:

Quote
sdk\propgrid\src\propgrid\propgrid.cpp:6804: warning: comparison is always false due to limited range of data type

and others, but less frequent.

But I also got errors, e.g.,:

Quote
sdk/manager.h:81: error: extra qualification 'Manager::' on member 'GetConfigManager'
sdk/configmanager.h:195: error: extra qualification 'ConfigManager::' on member 'Write'
sdk/editormanager.h:127: error: extra qualification 'EditorManager::' on member 'GetTree'
sdk/managedthread.h:14: error: extra qualification 'ManagedThread::' on member 'ManagedThread'
sdk/managedthread.h:15: error: extra qualification 'ManagedThread::' on member 'ManagedThread'
sdk/xtra_classes.h:22: error: extra qualification 'wxSplitPanel::' on member 'wxSplitPanel'
sdk/xtra_classes.h:25: error: extra qualification 'wxSplitPanel::' on member 'wxSplitPanel'
sdk/xtra_classes.h:37: error: extra qualification 'wxSplitPanel::' on member 'RefreshSplitter'
sdk/xtra_classes.h:39: error: extra qualification 'wxSplitPanel::' on member 'wxSplitPanel'

I have provided a patch to solve them, but I am not sure regarding the following:

Original:

Quote
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1 (SetPropertyValue, const wxPoint&);
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1 (SetPropertyValue, const wxSize&);
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1 (SetPropertyValue, const wxArrayInt&);

Solution:

Quote
/*wxPG_IMPLEMENT_PGMAN_METHOD_NORET1*/void SetPropertyValue(const wxPoint&);
/*wxPG_IMPLEMENT_PGMAN_METHOD_NORET1*/void SetPropertyValue(const wxSize&);
/*wxPG_IMPLEMENT_PGMAN_METHOD_NORET1*/void SetPropertyValue(const wxArrayInt&);

Anyway, the patch is attached to this post (I prefer to know the opinions of the devs, before posting it to SF (if the devs think it is worth).

Could not be worthy to use GCC 4.1.0 for build C::B instead of the previous versions, e.g., 3.4.5, 3.4.4 and 3.4.2? Or it is too early and could have compatibility problems?

Best wishes,
Michael


[attachment deleted by admin]
Title: Re: Building C::B with GCC 4.1.0
Post by: killerbot on February 01, 2006, 08:10:41 pm
propgrid also has this warning with the actual GCC (3.4.4)

I hope your patch get accepted, die warnings die ;-)
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 01, 2006, 08:43:40 pm
I hope your patch get accepted, die warnings die ;-)

Unfortunately, the patch just remove the errors :(. I hope anyway. Errors that I find a bit strange. Anyway, I think that some of the warnings could be relatively easy solved (at least the ones in C::B + contrib. plugins). I will work at it :).

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: Ceniza on February 02, 2006, 01:57:08 am
The "extra qualification" errors are really evil, even more those introduced by the use of macros. I created a post about this issue in the developers forum when I uploaded that version of GCC but it got no attention (at least no about that specific issue).

I'm still waiting for the release of GCC 4.1.0 final, which seems to be pretty close, to provide binaries for it.
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 02, 2006, 11:02:41 am
The "extra qualification" errors are really evil, even more those introduced by the use of macros. I created a post about this issue in the developers forum when I uploaded that version of GCC but it got no attention (at least no about that specific issue).

I will check your post. Yes, those introduced with the macros are probably the worst. I will try if the "solution" that worked for me, still work with a previous GCC version. If yes, I will post a Patch to SF.

I'm still waiting for the release of GCC 4.1.0 final, which seems to be pretty close, to provide binaries for it.

That would be good :D. I think it is possible to use GCC 4.1.0 to clean/improve the code (especially from warnings).

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: Ceniza on February 02, 2006, 04:03:41 pm
Quote from: Michael
I will check your post.

I think that's not possible. When I said "developers forum" I meant "developers only forum". I wonder if I also named it in the public thread :P

You'ren't missing anything really. I just named the problem, why and where it happened, but the only interest shown there was how I got to compile GCC 4.1.0 :)

I also hope your patch be accepted. It seems to be a matter of just a few weeks for GCC 4.1.0 final to be released, and it'll be surely available for Linux users first making Code::Blocks difficult to build there.
Title: Re: Building C::B with GCC 4.1.0
Post by: killerbot on February 02, 2006, 04:06:28 pm
now just the guys ate MingW need to catch up. Some weeks ago they proposed 3.4.5 :-(
We want the 4.x .
Title: Re: Building C::B with GCC 4.1.0
Post by: thomas on February 02, 2006, 04:14:14 pm
Quote
You'ren't missing anything really. I just named the problem, why and where it happened, but the only interest shown there was how I got to compile GCC 4.1.0 Smile
And I still have not managed to compile it... :(
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 02, 2006, 04:57:18 pm
Quote from: Michael
I will check your post.

I think that's not possible. When I said "developers forum" I meant "developers only forum". I wonder if I also named it in the public thread :P

Ah ok, I understand :D.

You'ren't missing anything really. I just named the problem, why and where it happened, but the only interest shown there was how I got to compile GCC 4.1.0 :)

Could be this piece of information made available? It would be really good :D.

I also hope your patch be accepted. It seems to be a matter of just a few weeks for GCC 4.1.0 final to be released, and it'll be surely available for Linux users first making Code::Blocks difficult to build there.

The patch was nothing particular. Just taking out the offending "extra qualification" errors. And testing if the modifications done were still backward compatible with GCC3.4.4. That was all :).

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: pandapanda on February 07, 2006, 08:52:07 am
Hello,

I have tried to compile C::B + contrib. plugins with GCC 4.1.0 (from Ceniza) and it worked quite well :D. I got a lot of warnings regarding wxWidgets (I think that Ceniza said already something about this). Especially of this type:

Best wishes,
Michael


you said "I have tried to compile C::B + contrib. plugins with GCC 4.1.0 (from Ceniza) and it worked quite well", can you tell me how to use this GCC 4.1.0 with step by step?
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 07, 2006, 10:57:09 am
Hello,

I have used the GCC 4.1.0 that Ceniza has provided :D. Check here (http://forums.codeblocks.org/index.php?topic=1739.0) for more info. Practically you should download MinGW if you not have it already. I have installed version 5.0. Then you download Ceniza's package, unzip it and copy and paste the repositories in MinGW. In C::B under Settings-->Compiler and debugger-->Directories tab-->Compiler tab, you add:

Quote
C:\Programme\MinGW\include  --> if MinGW is installed in C:\MinGW, then change it in C:\MinGW\include
C:\Programme\MinGW\include\c++\4.1.0  --> if MinGW is installed in C:\MinGW, it is not necessary
C:\Programme\MinGW\include\c++\4.1.0\mingw32  --> if MinGW is installed in C:\MinGW, it is not necessary

That's all, at least with me. If you have some problems, just post here.

Anyway, after installing MinGW, you should let C::B autodects it and then check if the pathes it has set are correctly. Then you add GCC 4.1.0 and modify the compiler path (with me it was necessary to avoid file not found errors).

Best wishes,
Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 07, 2006, 06:19:23 pm
Quote
sdk/propgrid/include/wx/propgrid/propgrid.h:2352: warning: 'class wxPropertyContainerMethods' has virtual functions but non-virtual destructor

Concerning this warning, I have found an interesting discussion in the Qt forum (http://lists.trolltech.com/qt-interest/2005-10/msg00200.html).

This FAQ (http://www.parashift.com/c++-faq-lite/virtual-functions.html) could also be helpful. At least it was for me :D.

[EDIT]: I also got this advice from a C++ expert:
Quote
If your constructor does nothing: better not to define it. You can define a dummy destructor - but if you do it, define it as virtual.

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: tiwag on February 09, 2006, 07:17:33 pm
is gcc 4.1 really so much faster than gcc 3.4  on  windows platform  ??

has anyone done a comparison already ,  if so please post results.

any issues with using gcc 4.1 ??
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 09, 2006, 07:36:52 pm
Hello,

Personally, I have not remarked a real speed difference between GCC 4.1.0 and GCC 3.4.4. The building time for C::B seems to be quite the same with both GCC 4.1.0 and GCC 3.4.4 (if we exclude the several warnings that GCC 4.1.0 displays: around 3600-3700 for C::B and 700-800 for contr. plugins. Until now C::B built with GCC 4.1.0 (debug) works not really faster that the same version compiled with GCC 3.4.4 (debug). May be a bit faster, but not so much.

Concerning the issues, I had to solve some with C::B, otherwise all seem to work well (until now :)).

Best wishes,
Michael

PS.: Anyway, the GCC 4.1.0 I am using (snapshot from Ceniza) is not the final release and this could have some influence.
Title: Re: Building C::B with GCC 4.1.0
Post by: thomas on February 09, 2006, 08:24:49 pm
I also got this advice from a C++ expert:
Quote
If your constructor does nothing: better not to define it. You can define a dummy destructor - but if you do it, define it as virtual.
This is actually quite a bad advice in my opinion. An empty constructor does not help, but it does not harm either.

On the other hand, a virtual destructor does harm. Maybe "harm" is the wrong word, let's say "cost", but the general idea is the same. At the very least, this bears an unnecessary storage cost of one pointer in the vtable plus one pointer for every allocated object. The single vtable entry may be neglegible, but if you allocate and deallocate 5 million objects, then carrying around one unnecessary v-ptr for each object may make a difference (as may the two additional pointer dereferences to call a destructor that does nothing...).
As always, the significance depends on what you do, but I think carrying around a penalty that you absolutely don't need is not a good idea.
You could say it is like using x++; or ++x;, the difference (if any) is not terribly big... but then, here we do bother ;)

The one and only case in which you really need a virtual destructor is when all of the following three conditions are met:
1. you have one or more virtual functions
2. you allocate an object of a derived class
3. you free this object as a type of the base class

For convenience, and for safety, one usually defines a virtual class' destructor virtual, as it does not make much difference (you have to carry the v-ptr around anyway) and you don't have to worry about who might derive from and tamper with your class.
However, it makes no sense at all to make a destructor virtual in a non-virtual class just for the sake of doing it.
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 09, 2006, 09:07:46 pm
I also got this advice from a C++ expert:
Quote
If your constructor does nothing: better not to define it. You can define a dummy destructor - but if you do it, define it as virtual.
This is actually quite a bad advice in my opinion. An empty constructor does not help, but it does not harm either.

On the other hand, a virtual destructor does harm. Maybe "harm" is the wrong word, let's say "cost", but the general idea is the same. At the very least, this bears an unnecessary storage cost of one pointer in the vtable plus one pointer for every allocated object. The single vtable entry may be neglegible, but if you allocate and deallocate 5 million objects, then carrying around one unnecessary v-ptr for each object may make a difference (as may the two additional pointer dereferences to call a destructor that does nothing...).
As always, the significance depends on what you do, but I think carrying around a penalty that you absolutely don't need is not a good idea.
You could say it is like using x++; or ++x;, the difference (if any) is not terribly big... but then, here we do bother ;)

The one and only case in which you really need a virtual destructor is when all of the following three conditions are met:
1. you have one or more virtual functions
2. you allocate an object of a derived class
3. you free this object as a type of the base class

For convenience, and for safety, one usually defines a virtual class' destructor virtual, as it does not make much difference (you have to carry the v-ptr around anyway) and you don't have to worry about who might derive from and tamper with your class.
However, it makes no sense at all to make a destructor virtual in a non-virtual class just for the sake of doing it.

Thank you very much for your explanation about virtual destructor :). What you say is correct. It is also what all the C++ websites I have looked at say. Anyway, I think that I have probably not correctly understood the advice of that person, who IMHO is a C++ expert (he is involved in the C++ Standardization Process and I would be very surprised if he had gave me an uncorrect advice). I will ask him and post here his answer.

Sorry for the not so accurate advice :oops: and thank you Thomas for pointing that out :D.

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: thomas on February 09, 2006, 09:26:59 pm
Anyway, I think that I have probably not correctly understood the advice of that person, who IMHO is a C++ expert
Maybe he said "if you add a dummy destructor to a virtual class, make it virtual"?
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 09, 2006, 09:50:37 pm
Anyway, I think that I have probably not correctly understood the advice of that person, who IMHO is a C++ expert
Maybe he said "if you add a dummy destructor to a virtual class, make it virtual"?

No. I have just copied and past his remark.

I have implemented a template PriorityQueue class, which made use of a multimap. But I did not derived my class from the STL multimap. My class was more a wrapper.

My constructor and destructor originally were defined as:

Code
template
<
typename A,
typename P,
typename Cmp=greater<P>
>
class PriorityQueue
{
public:
/*Default constructor*/
PriorityQueue(void);

/*Destructor*/
~PriorityQueue(void);
...
};


/*
Default constructor
*/
template
<
typename A,
typename P,
typename Cmp
>
PriorityQueue< A, P, Cmp >::PriorityQueue()
{
}

/*
Destructor
*/
template
<
typename A,
typename P,
typename Cmp
>
PriorityQueue< A, P, Cmp >::~PriorityQueue(void)
{
}
...

When I asked him what he thought about my class he answered me:

Quote
Minor remarks:

1. In the constructor and destructor:
   PriorityQueue(void)
   In C++ you dont need to write f(void), f() is the same.

2. If your constructor does nothing: better not to define it.
   You can define a dummy destructor - but if you do it,
   define it as virtual.

May be I have misunderstand something. Anyway, his explanation was not too much detailed.

Michael

[EDIT]: I can post my class, if you would like to look at it.
Title: Re: Building C::B with GCC 4.1.0
Post by: thomas on February 09, 2006, 10:07:39 pm
I don't get the point with the virtual destructor, to me it seems wrong. But hey, don't bother, I am neither God nor Stroustrup, so I would not know :)

In C++ you dont need to write f(void), f() is the same.
Isn't that the infamous construct that Stroustrup called an abomination? :lol:
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 09, 2006, 10:15:46 pm
In C++ you dont need to write f(void), f() is the same.
Isn't that the infamous construct that Stroustrup called an abomination? :lol:

Stroustrup calls it an abomination (http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.4), but Dennis and Doug too: :D:

Quote
Bjarne Stroustrup said this in an interview with Dr. Dobbs Journal:

Dennis Ritchie and Doug McIlroy famously gave me courage to break with
ANSI C in the issue of the declaration of a function with an empty
argument list. To preserve compatibility with K&R C, I had invented the

int f(void);

notation for C with Classes. Initially, I retained the old meaning of

int f();

as "f()" can accept any arguments that happens to be compatible with
f()'s (unseen) definition". Dennis and Doug called the f(void) style
declaration an abomination, so in C++

int f();

now has the obviuos meaning: "f() takes no arguments." Unfortunately,
ANSI C adopted f(void) so I had to introduce f(void) into C++ for ANSI C
compatibility.

Na ja, f() or f(void)... :D

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 10, 2006, 11:28:35 am
I don't get the point with the virtual destructor, to me it seems wrong. But hey, don't bother, I am neither God nor Stroustrup, so I would not know :)

It seems that I have misunderstood the remark of the expert :). His explanation was may be a bit too short :roll:. After asking him again he told me:

Quote
If you have a pure class, which has no virtual function, and you will likely _not_ to derive from this class: there is no reason to define a virtual destructor. You may still define a non-virtual destructor if you have to do some clean-up on the end of the object lifetime.

However if you create a class which is part of a class hierarchy, and you intend to derive other classes from this class, and even more if you plan to use this hierarchy in polymorphic way (i.e. calling virtual functions, etc...) it is a good design choice to create a virtual destructor, even if you have nothing to clean-up in the base class.

This seems to confirm what you have said.

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: thomas on February 14, 2006, 04:34:03 pm
Allow me to come back to this off-topic one last time :lol:

Apparently, this virtual destructor thing is a wide-spread misconception because I encountered a couple of people in the past few days who told me the exact same thing ("yea, it's a good thing, I always do it..."). The last one only a few minutes ago.

Thus, to visualize how expensive unnecessary virtual functions can be, I wrote the following code:
Code
#include <stdio.h>

class Integer {int a;};

class VirtualFoo{public: virtual ~VirtualFoo(){};};

class VirtualInteger
{
    int a;
public:
    virtual void Empty(){};
};

class MultiVirtualInteger: public VirtualFoo, public VirtualInteger {};

int main()
{
    int a;
    Integer b;
    VirtualInteger c;
    MultiVirtualInteger ow;
    Integer d[50000];
    Integer e[50000];
    VirtualInteger f[50000];
    MultiVirtualInteger this_hurts[50000];

    printf("int:\t\t\t %d\n", sizeof(a));
    printf("Integer:\t\t %d\n", sizeof(b));
    printf("VirtualInteger:\t\t %d\n", sizeof(c));
    printf("MultiVirtualInteger:\t %d\n\n", sizeof(ow));
    printf("int[]:\t\t\t %d\n", sizeof(d));
    printf("Integer[]:\t\t %d\n", sizeof(e));
    printf("VirtualInteger[]:\t %d\n", sizeof(f));
    printf("MultiVirtualInteger[]:\t %d\n", sizeof(this_hurts));

    return 0;
}
Please excuse the C/C++ mixture, I will probably never learn to use streams :P

The program outputs the following on a "typical" 32 bit machine:
Code
int:                     4
Integer:                 4
VirtualInteger:          8
MultiVirtualInteger:     12

int[]:                   200000
Integer[]:               200000
VirtualInteger[]:        400000
MultiVirtualInteger[]:   600000

Press any key to continue.
As can be seen, it costs nothing to encapsulate an integer into a class (I left out accessors, so it is not really useful, but let's not be picky). Contrarily, having virtual functions (even if it's just the empty destructor) costs one extra pointer per object (and per virtual inheritance). On a 64bit system, the overhead would of course be twice as much.

So, what do we learn from this? Virtual functions are evil, don't use them? No, surely not. Virtual functions are good and useful. But we should know that they are not free (especially not in combination with multiple inheritance, as shown).
Title: Re: Building C::B with GCC 4.1.0
Post by: killerbot on February 14, 2006, 04:48:44 pm
what brings us to the topic, that way to many people overutilize multiple inheritance.
Try to avoid it as much as possible. You should only inherit from interfaces (abstract classes), occassionaly you need to inherit from more then 1 interface, but normally you shouldn't (rethink your design) .
Too many people use inheritance to reuse implementation, it should be used for behaviour (!! : IS A relation ship). Most implementation reuse can be done through aggregation.

Typical example :
Shape, Circle, Square, Rectangle :
Shape : base
Derived from shape : Circle, Square and Rectangle

Square is not dereived from rectangle !!!! Square can be implemented by having inside a Rectangle member.

Say you have the method : SetWidth()/SetHeight() and it's Get equivalents. Basic expectations is, they get/set what they say. For a rectangle you will not expect that SetWidth() would change the height !! But for a square setting one, also changes the other. So a square does not behave like a rectangle --> IS NOT A --> so no inheritance, but you can easlity implement a square on the inside by using a rectangle (eg : Square :SetHeight -> on the rectangle inside set height and width).

Note that many textbooks have been using this as an example, and have shown it WRONG !!!
Mathimatically a square is a rectangle ,but not in behaviour. And behaviour is interfaces, and interfaces are subject for inheritance.
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 14, 2006, 07:23:13 pm
@Thomas

Your demostration is very interesting. Personally, I have always appreciated C++ multiple-inheritance (especially when programming with Java :D). Anyway, it has a cost as you correctly demonstrate. I just wonder if C++ Class Flattening could be used to reduce the overhead due to the virtual functions...

I am curious to know what all the books written by C++ Experts that I have bought, will say about it :D.

@Killerbot

As told above I like multiple-inheritance, but not wild inheritance. I just not use multiple-inheritance, because it exists. But I like that it is there in case of need. With Java it was different and I quite never felt comfortable with the interfaces and single inheritance.

Your examlple is also interesting and helpful.

The design of an application is a very important point and always underestimated. At the beginning, I just wanted to code and not waste my time with the design. Later, I had to change most of my code, because of errors and inefficiency. Now, I take more time to design my application in order to avoid problems later (but I still prefer to code :D).

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: killerbot on February 14, 2006, 08:17:15 pm
Quote
I am curious to know what all the books written by C++ Experts that I have bought, will say about it

Check out Scot Meyers and Herb Sutters their books ...
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 14, 2006, 08:22:18 pm
Quote
I am curious to know what all the books written by C++ Experts that I have bought, will say about it
Check out Scot Meyers and Herb Sutters their books ...

Unfortunately, I do not have those books :(.

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: thomas on February 14, 2006, 08:24:30 pm
Quote
I have always appreciated C++ multiple-inheritance (especially when programming with Java Very Happy). Anyway, it has a cost as you correctly demonstrate.
Multiple inheritance is really no bad thing, that's not what I wanted to demonstrate :lol:
My point was that multiple virtual inheritance is still more expensive than (single) virtual inheritance.

In fact, I believe that multiple inheritance is one of the best features of C++, you only have to keep a few things in your head. One such thing is the "Diamond of Dread", and another example is the extra memory cost for virtual base classes.

Let's not forget that neither Stroustrup is stupid, nor are the ISO committee members, so if multiple inheritance was really that bad, then it wouldn't have been implemented in the first place, and it would never have made it into the standard ;)

Java has no multiple inheritance mainly for three reasons:
1. A compiler (and a virtual machine) supporting multiple inheritance is harder to implement and requires more resources.
2. C++ was designed to write software that runs country-wide call-centers, international airports, and airline booking systems. Java was designed to run embedded smart appliances ( = toasters with internet access).
3. Multiple inheritance (C++ in general) is not fool-proof. You really have to know what you do, and you really have to think about what you do, or your life will be a very unhappy one. Java, however, was explicitely designed for fools. Java does not require the programmer to think about "dangerous" things (in fact, it does not even allow it). The good side (and certainly one reason why Java was so successful) is that this avoids many problems alltogether.
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on February 14, 2006, 08:49:16 pm
Quote
I have always appreciated C++ multiple-inheritance (especially when programming with Java Very Happy). Anyway, it has a cost as you correctly demonstrate.
Multiple inheritance is really no bad thing, that's not what I wanted to demonstrate :lol:
My point was that multiple virtual inheritance is still more expensive than (single) virtual inheritance.

In fact, I believe that multiple inheritance is one of the best features of C++, you only have to keep a few things in your head. One such thing is the "Diamond of Dread", and another example is the extra memory cost for virtual base classes.

Let's not forget that neither Stroustrup is stupid, nor are the ISO committee members, so if multiple inheritance was really that bad, then it wouldn't have been implemented in the first place, and it would never have made it into the standard ;)

Yes, I agree. If it was such an evil thing Stroustrup and the ISO C++ committee members would have never implemented it.

2. C++ was designed to write software that runs country-wide call-centers, international airports, and airline booking systems. Java was designed to run embedded smart appliances ( = toasters with internet access).

Well, toasters with internet access are especially useful for housewifes, or :D? So, they can prepare a tost while writing an email, speaking with a friend or watching the latest telenovela :).

To be serious, Java seems also to be useful to develop Web Services and related applications.

3. Multiple inheritance (C++ in general) is not fool-proof. You really have to know what you do, and you really have to think about what you do, or your life will be a very unhappy one. Java, however, was explicitely designed for fools. Java does not require the programmer to think about "dangerous" things (in fact, it does not even allow it). The good side (and certainly one reason why Java was so successful) is that this avoids many problems alltogether.

Yes, you are right about Java. Anyway, it is not easy in Java to develop efficient software.

Personally, I prefer a language as C++. May be more difficult to learn and master, but more powerful and flexible. I also wait to see what D will become.

Michael
Title: Re: Building C::B with GCC 4.1.0
Post by: Michael on April 25, 2006, 02:55:42 pm
Quote
You'ren't missing anything really. I just named the problem, why and where it happened, but the only interest shown there was how I got to compile GCC 4.1.0 Smile
And I still have not managed to compile it... :(

I am not sure, but may be this post (https://sourceforge.net/forum/message.php?msg_id=3702268) could help you to compile GCC 4.1.

Best wishes,
Michael