On Tue, Aug 21, 2012 at 4:33 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<catching up on old email><br>
<div class="im">On Aug 10, 2012, at 7:48 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br></div><div class="im">> 2) Command-line interface. We currently have the following options to enable various flavors of undefined</div>
<div class="im">
<br>
</div><div class="im">> I would like for us to have a single argument which enables all undefined behavior checking which can be performed cheaply and with no changes to address space layout or ABI; I propose we extend -fcatch-undefined-behavior to be that argument.<br>

<br>
</div>+1<br>
<div class="im"><br>
> I think we should support this kind of configuration through a mechanism similar to warning flags: -fcatch-undefined-behavior=c++11 -fno-catch-undefined-behavior=null-reference, for instance.<br>
<br>
</div>+1<br>
<div class="im"><br>
> Also, I think we should consider renaming this switch (and/or possibly the -f*-sanitizer switches) to provide a consistent set of names, but I don't have a concrete proposal for that.<br>
<br>
</div>That would make sense to me.</blockquote><div><br></div><div>Concrete proposal (based on ideas from Chandler): we run with the branding which -faddress-sanitizer and -fthread-sanitizer have established. Our new switch for all optional runtime checking is "-fsanitize=...". This should behave analogously to -W, and in particular, we should have sanitizer groups (as discussed elsewhere on this thread) and -fsanitize=no-<whatever>.</div>
<div><br></div><div>-faddress-sanitizer becomes a synonym for -fsanitize=address</div><div>-fthread-sanitizer becomes a synonym for -fsanitize=thread</div><div>-fcatch-undefined-behavior becomes a synonym for -fsanitize=undefined-fast</div>
<div>-ftrapv becomes a synonym for -fsanitize=signed-overflow</div><div><br></div><div>For compatibility with GCC and previous versions of Clang, these existing flags are retained. -fsanitize=address and -fsanitize=thread continue to be incompatible (a diagnostic will be produced for any attempt to combine them).</div>
<div><br></div><div>Thoughts?</div><div>-- </div><div>Richard</div></div>