[cfe-dev] Using STD exceptions in Clang code

Garrison Venn gvenn.cfe.dev at gmail.com
Mon Aug 1 10:19:59 PDT 2011


You may be affected by the fact that the clang libraries themselves (the ones 
you are using), are built by default with exceptions disabled. If you are throwing
"through" these libraries there would be an issue since cleanups would need to
be invoked (internal to the clang libraries). If this is the case, you can always
rebuild clang/llvm with exceptions on. Beyond a performance hit, I'm not sure
what the stability issues would be when using clang/llvm built with exceptions
enabled.

Hope this helps

Garrison

On Aug 1, 2011, at 12:56, Jorge Fernández Fabeiro wrote:

> Hi!
> 
> I am programming a little code rewriter using Clang libraries, and I need to catch an std::out_of_range exception to break the execution of a loop. When I try to compile the code, despite using the flag "-fexception", gcc tells me that the exception handling disabled, so I must use -fexceptions to enable it. 
> 
> I also tried to copy this piece of code into another C++ file (not depending on Clang libraries) and to compile it, and then it works with no problem.
> 
> Anyone can help me? Thank you very much!
> 
> PS: Sorry for my bad english, i'm not used to write this kind of messages. And it's also my first message sent to the list... 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list