On Friday, September 7, 2012, Chandler Carruth  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 7, 2012 at 3:57 PM, Daniel Dunbar <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'daniel@zuster.org');" target="_blank">daniel@zuster.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ddunbar<br>
Date: Fri Sep  7 14:57:20 2012<br>
New Revision: 163411<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=163411&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=163411&view=rev</a><br>
Log:<br>
[asan] Suppress some bogus -Winvalid-noreturn diagnostics.<br></blockquote><div><br></div><div>Please no. This is not the right way to suppress these. This code is hard enough to read w/o adding pragmas to the mix.</div>

<div><br></div><div>If this warning is bogus, we should fix the warning.</div></div></div></blockquote><div><br></div><div>The warning is not bogus, but I don't think we are going to fix Clang to detect the situation where the RAII object destructor causes a noreturn.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><div>If the warning is correct we should fix the code.</div>
<div><br></div><div>If the warning is correct, but this code *cannot* comply with the warning, we should just turn it off in the flags when compiling this file.</div></div></div></blockquote><div><br></div><div>I personally prefer the local edit to the non-local one.</div>
<div><br></div><div> - Daniel</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    compiler-rt/trunk/lib/asan/asan_report.cc<br>
<br>
Modified: compiler-rt/trunk/lib/asan/asan_report.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=163411&r1=163410&r2=163411&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=163411&r1=163410&r2=163411&view=diff</a><br>


==============================================================================<br>
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)<br>
+++ compiler-rt/trunk/lib/asan/asan_report.cc Fri Sep  7 14:57:20 2012<br>
@@ -270,6 +270,9 @@<br>
   }<br>
 };<br>
<br>
+#pragma clang diagnostic push<br>
+#pragma clang diagnostic ignored "-Winvalid-noreturn"<br>
+<br>
 void ReportSIGSEGV(uptr pc, uptr sp, uptr bp, uptr addr) {<br>
   ScopedInErrorReport in_report;<br>
   Report("ERROR: AddressSanitizer crashed on unknown address %p"<br>
@@ -326,6 +329,8 @@<br>
   DescribeAddress((uptr)offset2, length2);<br>
 }<br>
<br>
+#pragma clang diagnostic pop<br>
+<br>
 // ----------------------- Mac-specific reports ----------------- {{{1<br>
<br>
 void WarnMacFreeUnallocated(<br>
@@ -339,6 +344,9 @@<br>
   DescribeHeapAddress(addr, 1);<br>
 }<br>
<br>
+#pragma clang diagnostic push<br>
+#pragma clang diagnostic ignored "-Winvalid-noreturn"<br>
+<br>
 void ReportMacMzReallocUnknown(<br>
     uptr addr, uptr zone_ptr, const char *zone_name, StackTrace *stack) {<br>
   ScopedInErrorReport in_report;<br>
@@ -361,6 +369,8 @@<br>
   DescribeHeapAddress(addr, 1);<br>
 }<br>
<br>
+#pragma clang diagnostic pop<br>
+<br>
 }  // namespace __asan<br>
<br>
 // --------------------------- Interface --------------------- {{{1<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="javascript:_e({}, 'cvml', 'llvm-commits@cs.uiuc.edu');" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</blockquote>