Pierre Phaneuf wrote:
>
> Sorry for the slightly offtopic question, but I know that people around
> here have dealed with this in the past, so...
>
> Is there any valid reason to compile library code that doesn't use
> exceptions or RTTI with them enabled?
>
> For example, if a client program uses exceptions and/or RTTI (and is
> thus compiled with those features enabled), is there a problem with
> linking against a library that was compiled with those features
> disabled?
As far as RTTI no, you shouldn't encounter any problems, as long as you
don't try and use RTTI on objects in the library.
As far as exceptions, what you have to worry about is callbacks. If you
provide a callback to the library, don't throw an exception within the
callback function or call a function that might throw an exception and
not catch it. It may actually work on some systems, depending on how the
exception handling is implemented, but don't count on it.
A concrete example is the C runtime library functions. They were not
compiled with RTI or exceptions, but you can call them just fine.