title: How to terminate clang-instrumented program when clang-sanitizer finds an error?
body: <p>Say I have the following program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  float foo(float f)
      { return (f / 0); }
  
  int main(void) {
      foo(1.0f);
      std::cout &lt;&lt; "hello" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>If I invoke <code>clang++ -fsanitize=undefined main.cpp &amp;&amp; ./a.out</code> then it will output:</p>
  
  <pre><code>main.cpp:4:32: runtime error: division by zero
  hello
  </code></pre>
  
  <p>Is there a way to terminate <code>a.out</code> as soon as an error is detected? I.e. in such a way that it displays:</p>
  
  <pre><code>main.cpp:4:32: runtime error: division by zero
  </code></pre>
  
  <p>without displaying <code>hello</code> on the following line? (because it will have terminated before)</p>