3 ms·
The exception handling code in the GCC library is a lot more than 600 bytes. But if you were linking with the shared library, it won't be reflected in the size
by WalterBright 10y ago
The exception handling code in the GCC library is a lot more than 600 bytes. But if you were linking with the shared library, it won't be reflected in the size of the executable. Linking with the static library may show a quite different story.
- deleted 10y ago[deleted]
- mattkrause 10y agoEven when linked statically, my "Hello World" program is only 10,332 bytes larger than something which prints "Hello World" and then throws an integer. Building the no exceptions version with -fno-exceptions doesn't change the size of the exception-free version either. (g++ 4.8.5 with -Os)
- WalterBright 10y agoAll functions get compiled with exception handling unwind data, so you're going to get that pulled in whether the executable throws or not. In order to not get that, you'll likely have to rebuild the entire runtime library with EH turned off.