Re: [arm-gnu] Ho to REALLY disable C++ exceptions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Ho to REALLY disable C++ exceptions?



On Sat, 2009-10-31 at 11:21 +0100, Freddie Chopin wrote:
> Hi,
> 
> is it possible to disable C++ exceptions handling completely? The code I 
> have compiles to 1.7kB, but when I use something that does throw an 
> exception, let it be new operator:
> 
> > class C {};
> > 
> > int main (void)
> > {
> > 	C* c = new C();
> > ...
> 
> The code size rises to over 60kB. Using the compiler option 
> -fno-exceptions in reality makes no difference - without that option the 
> code size is ~100bytes more.
> 
> Thx in advance!

You probably want to use new(nothrow).

Note, the C++ spec (and most of the C++ library) is fairly heavily
skewed towards having exceptions enabled; you'll have to code things
carefully to avoid that.

R.