2005.10.17 03:43 "[Tiff] newbie asks for help with mingw and libtiff", by

2005.10.26 18:05 "Re: [Tiff] Re: checking test images", by Bob Friesenhahn

The thing with the errormanager... There isn't much help with it in the man pages. I tried to find help with the provided sources of tools. I tried to compare it with jpeg.lib and png.lib that use a similar system. Jpeg.lib uses longjump and a jumpbuffer to jump from the errorhandler function to a block of instruction. Png.lib uses exceptions and/or longjumps in the same manner. Since both keep track of allocated memory and provide "abort and cleanup" functions it is save (?) that way. I only used the png approach with try and catch. Thank you for your notes. I will try and see if I can cleanup my code some more.

The libjpeg and libpng approach is definitely not "safe". It requires that the library and library user take great care in order to make sure that memory is not leaked. Use of setjmp/longjmp is not trivial by any means and they are not assured to be thread safe. Setjmp/longjmp are based on platform/CPU specific implementations which play tricks with the stack and CPU registers.

For C language, I definitely prefer synchronous error handling rather than asynchronous. C++ is another matter entirely since the language provides what is needed to ensure that allocated data can be safely destroyed in exception-safe code.