-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
I'm designing a tool that has a component that requires linking or incorporating into a "host" codebase to (portably) augment an application with a websocket server.
The requirement already involves the clang/LLVM compiler environment so it does narrow things down somewhat, but I am slightly worried about C++ exception support being required in order to compile a translation unit that includes websocketpp headers.
In particular I anticipate a hypothetical situation involving the need to link my static library containing a websocketpp server with a codebase that requires -fno-exceptions
in its build configuration. Suppose that it magically breaks when that isn't the case...
So there are two things that I am wondering about:
- It seems possible to mix-and-match object files which were compiled with and without exceptions, during linking. What are the consequences of this? Presumably the presence of any linked code supporting exceptions will "infect" the executable with exception support.
- I see many parts of the API of websocketpp having two versions: one that throws, and one that doesn't. I wonder if it is feasible to support a preprocessor define that can disable all code that
throw
s? This is only reasonable to ask for if none of the internal control flow and algorithms rely on C++ exceptions (which I hope is the case).
As for (2), though, it might not be practical because I see some hints such as this from the changelog
Should make it impossible for exceptions to bubble out of transport methods like
io_service::run
.
indicating that exceptions are an important part of the logic.