<br><br><div class="gmail_quote">On Tue, Nov 15, 2011 at 7:10 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="HOEnZb"><div class="adm"><div id="q_133aa6e1daf6b9fe_0" class="ajR h4"><div class="ajT"></div></div></div><div class="h5">On Nov 15, 2011, at 6:40 PM, Eli Friedman wrote:<br>
> On Tue, Nov 15, 2011 at 6:22 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
>> Hello,<br>
>> Please review the following patch which adds -fasan (AddressSanitizer) flag<br>
>> to clang.<br>
>> (Mostly prepared by Chandler Carruth).<br>
>> The LLVM part of AddressSanitizer has been submitted as r144758.<br>
>> This patch will allow to enable AddressSanitizer from the clang command<br>
>> line.<br>
>> <a href="http://codereview.appspot.com/5396042" target="_blank">http://codereview.appspot.com/5396042</a><br>
>> Coming next in separate patches:<br>
>>   - a patch to clang driver to pass linker flags for AddressSanitizer<br>
>> (small)<br>
>>   - the run-time library and the tests (big)<br>
>> Thanks,<br>
>> --kcc<br>
><br>
> I would prefer -faddress-sanitizer over -fasan; shorter isn't really<br>
> better here.<br>
><br>
> +  if (Args.hasFlag(options::OPT_fasan, options::OPT_fno_asan, false)) {<br>
> +    CmdArgs.push_back("-DADDRESS_SANITIZER=1");<br>
> +  }<br>
> }<br>
><br>
> Why would a program need this?  Can a program that's aware of the<br>
> address sanitizer actually do anything usefully different?  Also,<br>
> since this define doesn't start with an underscore, it's possible this<br>
> could break a program using the identifier ADDRESS_SANITIZER for<br>
> something else.<br>
<br>
</div></div>It would be reasonable to make this a has_feature check.<br></blockquote><div><br></div><div>Is that supported by gcc? </div><div>I'd prefer to have a compiler-neutral thing. </div><div><br></div><div>--kcc </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<span class="HOEnZb"><font color="#888888"><br>
John.<br>
</font></span></blockquote></div><br>