<div dir="ltr">You can use "UBSAN_OPTIONS=halt_on_error=1" in the environment to detect the problem without letting execution continue.<div><br></div><div>Maybe you could use -fsanitize-trap=undefined and -ftrap=function?  <a href="http://clang.llvm.org/docs/UsersManual.html#cmdoption-ftrap-function">http://clang.llvm.org/docs/UsersManual.html#cmdoption-ftrap-function</a><br><div> <br></div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 6, 2015 at 6:34 AM, Stéphane Letz <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
We are trying to use -fsanitize=integer to detect integer overflow errors. The message "runtime error: signed integer overflow" is generated, but is seems not as a catchable C++ exception. We would like to use try {…code that possibly overflow…. } catch (std::runtime_error& e) { } kind of code to handle the exception.<br>
<br>
It that possible? If not is there any alternative to detect integer overflow errors ?<br>
<br>
Thanks.<br>
<span class="HOEnZb"><font color="#888888"><br>
Stéphane Letz<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">-Brian</div>
</div>