I am working on porting a Visual C ++ application to GCC (should be built on MingW and Linux).
Existing code uses __try { ... } __except(1) { ... }blocks in several places, so almost nothing (perhaps due to errors like memory?) Will lead to the exit of the program without minimal logging.
What are the options for doing something similar with GCC?
Edit: thanks for the pointer to the / EH options in Visual Studio, now I need some examples of how to handle signals in Linux. I have found this post since 2002.
What other signals besides SIGFPEand SIGSEVGshould be monitored? (Basically caring for those that could be raised from me, something is wrong)
Bounty Information : I want my application to be able to log as many errors as possible before it comes out.
What signals can I receive, and it is usually not possible to register an error message after? (From memory, what else?)
How can I handle exceptions and (most importantly) signals in a portable way so that the code at least works the same on Linux and MingW. #ifdef is fine.
The reason I have more than just a wrapper process that registers a failure is because for performance reasons I keep writing data to disk until the last minute, so if something goes wrong, I want to make every possible attempt to write data before exiting.