C++ exception code size / recommended practice

Tim Jansen ml@tjansen.de
Wed Apr 9 23:59:00 GMT 2003


Hi...

I wonder what are the recommended practices for decreasing code size of C++ 
applications with exceptions. I switched a project from -fno-exceptions to 
regular exception support. This increased the size of the two binaries, after 
stripping, from 370572 and 39660 bytes to 581308 and 58408, respectively. 
Thus the increase in code size is > 50% (compiler: GCC 3.3 20030226 from SuSE 
8.2). 

Are there any hopes to make the overhead smaller on 3.x gccs? Is a throws() 
clause in the declaration recommended or not? It would be desirable for API 
documentation purposes and a paper claimed that empty throws() decreases the 
code size in VisualC++, but with gcc I noticed another small increase.
Or, possibly, could the reason for the increase be that the app uses a 
-fno-exceptions library (Qt) extensively?

I would appreciate any suggestions.

bye...




More information about the Gcc mailing list