Re: [?] egcs increases C++ binary size dramatically
On Tue, Apr 07, 1998 at 04:43:31PM +0200, Bernhard Rosenkraenzer wrote:
> On Mon, 6 Apr 1998, Dirk Eddelbuettel wrote:
>
> > I did not change any configuration options. I compiled the older package with
> > the latest GNU gcc/g++ 2.7.*, and the new one with egcc/eg++. xpdf makes
> > quite heavy use of C++, but as it worked with GNU g++ for years, I think we
> > can exclude templates, exceptions, ... And yes, the new one is stripped as
> > well.
> >
> > Isn't the size increase a bit much ? Comments ?
>
> It's related to the fact that egcs does exception handling - add
> -fno-exceptions to your CFLAGS, and you'll get a shorter binary.
I think this is not the right way to think of C++ programming. If you don't
use exceptions, you are free to disable them, but they are really an
integrated feature in the standard. GNU g++ had poorly to none exception
handling, egcs does a better job here, but maybe it is not optimized for
size yet.
However, you can give the compiler a hint that a function does not throw any
exceptions by adding throw() at the right place:
class ABC {
ABC (int theInt) throw();
}
for example. I don't know if egcs does make use of this promise by the
programmer, but it certainly should. Take the bigger binary as a sign that
the C++ support gets better. Maybe the size will go down again if it gets
again far more better.
Marcus
--
"Rhubarb is no Egyptian god." Debian GNU/Linux finger brinkmd@
Marcus Brinkmann http://www.debian.org master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de for public PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ PGP Key ID 36E7CD09
--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: