[llvm-commits] [compiler-rt] r163411 - /compiler-rt/trunk/lib/asan/asan_report.cc

Chandler Carruth chandlerc at google.com
Fri Sep 7 13:03:29 PDT 2012


On Fri, Sep 7, 2012 at 3:57 PM, Daniel Dunbar <daniel at zuster.org> wrote:

> Author: ddunbar
> Date: Fri Sep  7 14:57:20 2012
> New Revision: 163411
>
> URL: http://llvm.org/viewvc/llvm-project?rev=163411&view=rev
> Log:
> [asan] Suppress some bogus -Winvalid-noreturn diagnostics.
>

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.

If this warning is bogus, we should fix the warning.

If the warning is correct we should fix the code.

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.


>
> Modified:
>     compiler-rt/trunk/lib/asan/asan_report.cc
>
> Modified: compiler-rt/trunk/lib/asan/asan_report.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=163411&r1=163410&r2=163411&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_report.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_report.cc Fri Sep  7 14:57:20 2012
> @@ -270,6 +270,9 @@
>    }
>  };
>
> +#pragma clang diagnostic push
> +#pragma clang diagnostic ignored "-Winvalid-noreturn"
> +
>  void ReportSIGSEGV(uptr pc, uptr sp, uptr bp, uptr addr) {
>    ScopedInErrorReport in_report;
>    Report("ERROR: AddressSanitizer crashed on unknown address %p"
> @@ -326,6 +329,8 @@
>    DescribeAddress((uptr)offset2, length2);
>  }
>
> +#pragma clang diagnostic pop
> +
>  // ----------------------- Mac-specific reports ----------------- {{{1
>
>  void WarnMacFreeUnallocated(
> @@ -339,6 +344,9 @@
>    DescribeHeapAddress(addr, 1);
>  }
>
> +#pragma clang diagnostic push
> +#pragma clang diagnostic ignored "-Winvalid-noreturn"
> +
>  void ReportMacMzReallocUnknown(
>      uptr addr, uptr zone_ptr, const char *zone_name, StackTrace *stack) {
>    ScopedInErrorReport in_report;
> @@ -361,6 +369,8 @@
>    DescribeHeapAddress(addr, 1);
>  }
>
> +#pragma clang diagnostic pop
> +
>  }  // namespace __asan
>
>  // --------------------------- Interface --------------------- {{{1
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120907/f8a62b93/attachment.html>


More information about the llvm-commits mailing list